|
I have an problem whit A.I car. How do I stop the car to drive backwards after a crash and return to its normal position and continue driving on your way? here is the code:
(comments are locked)
|
|
I'm sorry but I couldn't arse myself to decipher the code, but I have a simple suggestion: Install a COLLIDER in your car (supposed that you haven't done it already), and in your vehicle script you implement the appropriate hit or trigger function, as detailed in the manual: http://unity3d.com/support/documentation/ScriptReference/Collider.html I have attached the collider in the car, but still, when a collision with another car and turned the waypoint position. The car was still running in fallback position
Aug 04 '11 at 03:32 PM
ourchat
If I'm not mistaken, what happens is that the collision changes the actual bearing of the car, so the FIRST direction calculations get offset. I think that after a collision you just need to make another call to NavigateTowardsWaypoint to assure that the correct new bearing is calculated.
Aug 04 '11 at 08:20 PM
roamcel
(comments are locked)
|

Please format your code properly! Edit your post, select the whole script and press the 101010 button. It's much easier for people to help you if they can read your code :)
Thank you, I myself was also confused by what I wrote yesterday :)