- Home /
How to make this kind of control ?
Hi everyone. I am beginner on scripting. I want to make a clone of this game http://www.bettergames.ru/game.php?id=552 But a can't understand how to make this rect to move like in thus game? Any ideias ? I was using gameObject.transform.Translate (3, 0, 0* Time.deltaTime);
It moved the Gameobject to fast ( time.deltatime didn't work ). Also anybodu know how to make particales folowing the Gameobject?
Answer by Berge · Apr 21, 2015 at 11:53 AM
Have a look at the documentation to make sure you are using transform.translate method right. http://docs.unity3d.com/ScriptReference/Transform.Translate.html
You need to multiply the change (X-value) with time.deltatime. Multiplying the z value (which is 0) will have no effect. We use the time.deltatime to reduce the value so that after one second, no matter how many times the method has been called, the total movement will be the value you multiply it with (x-value).
Answer by Baste · Apr 21, 2015 at 12:39 PM
You're multiplying the third zero with deltaTime, instead of the x-coordinate. You want
gameObject.transform.Translate (3 * Time.deltaTime, 0, 0);
Also, you should really, really look into the tutorials, especially the scripting parts. Roll-a-Ball is a good starting point.
Your answer
![](https://koobas.hobune.stream/wayback/20220613193648im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to make camera position relative to a specific target. 1 Answer
Particle system not destroying. 3 Answers
GUI controlling other game objects 0 Answers
Compilor Error - Adding a new ParticleEmitter to the object 0 Answers
How to create shoots 2 Answers