- Home /
controle of an gameobject
hi i have a problem with an object that i want move it by using C# script i try to use the function of velocity then i create two button and i use an event trigger and i use those function in the C# script but the object still don't want to move ? can someone tell me where is the problem ?
untitled.png
(70.9 kB)
untitled.png
(34.7 kB)
Comment
Did you add controle.cs to the object you want to move?
Did you add a RigidBody to the object?
Can you verify that speed has a value other than 0 in the inspector for the object?
Answer by aldonaletto · Jun 30, 2017 at 03:02 AM
This worked fine for me. Maybe the Rigidbody2D settings is causing the problem - compare to mine:
NOTE: I've set Freeze Position Y in order to avoid gravity in my test.
rigidbody2d.png
(24.6 kB)