- Home /
physics based path system?
How would you make a physics-based path system? For example like a Hot Wheels track where you can launch a car and it would travel on a track being affected by force and gravity and it would roll back down in reverse if the incline is too steep. Most waypoint systems I've seen use transform.position which does not use momentum or gravity. My idea would be to travel using Addforce Impulse going through waypoints / bezier path.
Answer by Llama_w_2Ls · Oct 17, 2021 at 07:26 AM
I suppose you would have a 3D grid of cells, and each cell is determined walkable by whether there is a track there or not.
You can use the A* pathfinding algorithm to find the best path between a start node and a destination node, and use a simple coroutine to add force in the direction of the current cell to the next, to move between the cells like a rigidbody would.