- Home /
Waypoint system trouble.
Greetings Unity Community.
This is my first post here, but alas it is the first time i have needed help.
I am currently undertaking a large assignment at university for which i want to add a traffic simulator (basic), and we are using the Unity engine. Now i have Roads, buildings ect all modelled and inside of the scene. I also have a C# script that controls movement of each Car using waypoints.
The script tells the car to face the current waypoint and move to it, then when it hits the trigger, switch to the next one.
One problem i understand to be due to the axis on the actual model, rather than inside of unity, and so i have managed to get past that with the less than preferable attatch to empty solution, however, regardless of the fact that i am using an equation for smooth turning, the car always seems to go around the waypoint, turn to far or simply fall through the floor regardless of colliders.
Any solutions, tips or otherwise alternative methods would be appreciated.
Please dont link me to an older thread, i have been reading them all for the past 3 hours trying to find a solution.
Please Unity Community, you are my only hope.
Not entirely sure what you mean by the cars going around the waypoints, exactly how are they turning?
However, ill throw this out there and maybe it helps: If your models fall through the floor, try adding or replacing the collider by simpler ones (for example, replace the mesh collider by a box collider, even though there should be no difference).
Attach a Rigidbody to the asset, my general experience is that these tend to solve physics-related issues at times (even if physics doesn't necessarily play a part in the scene).
Childing a mesh to an 'empty' parent isn't a bad practice. In fact, when done this way you should just attach your script and rigidbody to the 'empty' parent. When you do this, the rigidbody finds all colliders in it's children. Aside from those tips, I'm not sure what you're problem actually is; facing the right way?