Forum rules - please read before posting.

3D Pathfinding for NPCs in a 2D game

Hello,

Is it possible to use Adventure Creator + Unity Navigation to control NPCs in 3D space whilst having all the gameplay and interactions taking place using 2D colliders?

I have a working version of this where I use Simple Waypoint System, but I would much prefer to avoid extra tools and use native AC stuff so I can tell NPCs to pathfind to 3D markers and have that extra control in Action Lists.

I'll post a video of my current prototype when I get home, but for now here's a clip from INSIDE that should illustrate my question:


The gameplay takes place in 2D space, with the character platforming about in XY, but the dog pathfinds in 3D through the background of the scene and triggers the death event when it reaches the boy.

Is this possible to achieve solely in Adventure Creator, without having to create extra systems?

Kindest,
Mark

Comments

  • Inside might play on a 2D plane, but its still inherently a 3D game.

    I'm not sure why you're looking to use 2D colliders, but if the camera and movement occurs in 3D then they're generally not reliable to use since they assume "no depth".

    2D characters can still be used in 3D space, however.  If you replace their 2D components with 3D ones (Rigidbody, Capsule Collider), but keep their sprite child / animation engine, they'll be able to move about in 3D space and react to 3D collisions as a "true" 3D character would.
  • Thanks for the response, Chris.

    I'm looking to use 2D colliders as I'm building my movement engine with Unity 2D physics and the vast majority of gameplay will take place on the XY plane.

    Here's a video of the prototype:

    https://www.youtube.com/watch?v=RvP7XChIF7k

    I quite like the ability to be able to interact with NPCs in the background as if they were on a 2D plane, whilst still having them move about in 3D. It would just be nice to have the background capsule walk over to the table before continuing an action list, for example.



  • Think I figured it out.

    I changed the game to be 3D like you suggested, but set the motion control to manual during normal gameplay, then during cutscenes i disable platforming movement and flick motion control to automatic, which allows the character to pathfind to 3D markers.

    When the cutscene ends,  I can pathfind back to z 0, set movement to manual, and resume 2D platforming controls.

    Thanks for pointing me in the right direction.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.