- Home /
translate forward dont work
Hi everyone! I cant do transfom.Translate in a object. Anyone knows why? I want to transform forward, I use the script, for this. The object dont have any other script on it. And only have a animation to ratate, the wich dont affect the position keys.
Any idea?
To get help, share your code, at least the function containing transform.Translate
And let us know in what way you can't do it. Are you getting an error, or is nothing happening?
Answer by malekbakeer · May 06, 2014 at 01:01 PM
var speed : float = 0.1;
function Update ()
{
if (Input.GetKey(KeyCode.W))
{
transform.Translate(Vector3.forward * speed);
}
}
//NOTE : Change the speed variable as you want
Your answer
Follow this Question
Related Questions
Please help me with my unity puzzle game scripts 1 Answer
How do you get your character to look the way you are walking? 1 Answer
how to enable and disable script. 1 Answer
Is it standard practice for game items to run multiple scripts? 1 Answer
Scripts of Objects which I've deleted through the editor still exist and are run 0 Answers