- Home /
Question by
EliteHedgehog56 · Dec 06, 2018 at 03:56 AM ·
playeraicontrolracing game
ai variant of car script
I am creating a F-Zero style game, anyway I am wanting to put some ai racers into the game so I have someone to race against in singleplayer. Is there a way I can modify my player ship script to use as a script for my ai ships?
var speed : float = 10.0;
var turnspeed : float = 100;
var thrustForce: float;
function Update (){
thrust = Input.GetAxis("Vertical");
turn = Input.GetAxis("Horizontal");
transform.Translate(thrust*Vector3.forward*Time.deltaTime*speed);
transform.Rotate(turn*Vector3.up*Time.deltaTime*turnspeed);
}
Comment