Set manually paths and player should walk to clicked location?

Im quite new to game development, I designed some elements and I made a grid building system.
What is my game about?
I build a airport and there the cars should follow the taxi lines. The user can build the taxi lines in many ways. I have made for every direction a tile/block.
What I wanna do:
I want so set for each tile/block the path. Because the cars should only drive on the taxi line and not nearby. So when the user selected a car and then clicks on somewhere in the map. Then the car should find the nearest path to it over the tax lines. I do not think that a collider is the right solution in this situation.
What my problem is:
Idk how I should do it.

I hope anybody can provide some code example and the right solution.

BTW: I prefer scriptable objects.


In our Unity 3D course (Complete C# Unity Game Developer 3D Online Course - 2020), we cover the NavMesh and a pathfinding algorithm (and other things). You can also find free tutorials on many topics on Youtube. Maybe Realm Rush (in our Unity 3D course) contains a few techniques which might also be useful in your own game. Since Unity is actually a 3D game engine, it does not matter whether you develop a 2D or a 3D game.

Also please feel free to ask our helpful community of students for further advice over on our Discord chat server.

Hopefully, this helped. :slight_smile:

I searched on YouTube and on the web. There are only pathfinding tutorials with colliders or NavMesh. The problem there is that I cant use a collider.

Then use a NavMesh. At some point, you’ll have to test the available tools to figure out the limits. If they don’t fit your needs, you’ll either have to develop your own solution, or you’ll have to come to a compromise.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms