Okay, well here is what I use, all it does it allows enemies to follow a waypoint one after another
var waypoint : Transform; static var speed : float = 5; private var currentWaypoint : int;
This goes in your enemy!
This code below, goes into a game empty:
Now with that, what you do is create a game empty on your scene, then drag that script onto with. Where ever this point is, the enemy will walk to it. You can have more than one waypoint. Just means the enemy will walk to one waypoint, then to the other
answered Nov 25, 2010 at 09:08 PM
There are tons of different ways.
The solution above may work for you. Personally I prefer using a spline path (Bezier curves faded together, basically; the forum has a few implementations available) which represents the optimal drive line. You then have each car attempt to match their rotation to the path's direction at the closest point to the car.
answered Nov 25, 2010 at 09:13 PM
Console says (unknown identifier: "velocity") Is says this for last line of code on the first script (rigidbidy.velocity = velocity;)
answered Jul 18, 2011 at 07:40 PM
just replace rigidbody.velocity = velocity;
in rigidbody.velocity = speed;
answered Jul 18, 2011 at 08:21 PM