- Home /
How to move a object by an object
What I want to do is when I move a object "up" with the "up arrow key" that an other object goes slowly to the "left" (so thes the more I go up the more the objects goes to the left) and when I go "down" that the other object goes to the "right".
Thanks in advance!
Comment
Answer by Berenger · Feb 07, 2013 at 02:49 PM
Put the script listening for input on each object you want to move. Expose the arrows keycode to modify them in the inspector :
var up : KeyCode;
var down : KeyCode;
// ...
For the first object, up is up etc. For the second one, up is left.
This is not easy to do and your code that you wrote is more than easy. And I program in C# only. What I want is difficult.