- Home /
Ideas on pathfinding and collisions
Ideas on path finding and collisions
Hello, I am still quite new to Unity, 3D and some elements of game design so forgive me for my lack of knowledge on the subject. I am designing and developing a isometric view 2D game which I will then build in Unity.
Here is a isometric view of the floor plan from a sample level (grey is the floor and black is just empty space, and I have left out the walls for now)
The problems I need to tackle are the following
Path finding (AI moving around the level) Collisions (Both player and AI moving around and not moving outside of the floor of the level)
What I have so far
Quad meshes with 2D textures that form the level
A main camera in orthographic projection facing the quads
Possible solutions
Path finding
I am aware of Unity Navmeshes and Arongranberg A* path finding tool. I know that these support 3D colliders, and Arongranberg A* path finding supports 2D as well. I am thinking of using one of these methods for path finding. Is it only possible to set up a grid pathing map or navmesh on a 3D mesh?
So I have my quads with 2D textures on them, then I was thinking of overlaying a 3D purely for navigation pathing purposes, this mesh would be invisible. The problem I am having is how to align the 3D mesh floor with the 2D floor plan. Is it possible to do this? Or am I going at this all the wrong way and there are multiple better methods around this issue?
Diagram of overlaying 3D mesh in front of 2D texture.
Collisions
I tried to use a polygon collider but it didn’t create enough vertices to be accurate enough to cover the whole impassable areas. Is there a way I can make it so the player and the AI are contained within the floor only?
Quads with background texture
My idea of a invisible pathing 3D mesh overlayed over texture in order for it to be used by grid path finding or Navmesh
Really I just need advice and guidance on what are the fundamental methods of tacking these certain problems. Is there some concepts in Unity game design that I am missing out? Am I approaching this all the wrong way.