- Home /
car move automatically script for mobile
in my game the car moving automatically on touch screen and the player just move left and right I need to correct my script...
var forwardSpeed : float = 3; var turnSpeed : float = 2;
function Update() {
var forwardMoveAmount = Input.GetAxis("Vertical")*forwardSpeed;
var turnAmount = Input.GetAxis("Horizontal")*turnSpeed;
transform.Rotate(0,turnAmount,0);
transform.Translate(Vector3.forward * Input.GetAxis("Vertical") * Time.deltaTime*30);
if (Input.GetKey ("escape")) {
Application.Quit();}
}
You may ant to learn how to format code on this site.
firstly, thanks for your add. but I need to know script you talking about really I need it to complete the Game actually I'm new in scripting and if you help me I'll be thankful.
Your answer
Follow this Question
Related Questions
Android: move character where I touch the screen 1 Answer
Lean touch - Move object in X and Z axis 0 Answers
Move ad Stretch a 3D model for a touch game 0 Answers
Time delay on touch 0 Answers
iOS / Android Steering 2 Answers