- Home /
how to reorient the axes ?
i am new to unity . i am developing a game using voice recognition how to make an object move in forward direction when object is rotated? the problem i am facing is when object is rotates and gives a diection to move forward it actually should move towards z direction but it is moving in same x direction?
Answer by BastianUrbach · Jan 26, 2019 at 09:41 AM
How do you move the object? If you're using transform.Translate() then you can use either Space.Self (to move along local axes) or Space.World (to move along global axes). You can also use transform.forward which gives you the local forward direction.
i use transform.rotate then to move forward i couldn't move forward ins$$anonymous$$d i move along sideward so can you help me out
transform.Translate(0, 0, 1, Space.Self);
to move by one unit along the local z axis or
transform.Translate(0, 0, 1, Space.World);
to move by one unit along the global z-axis.
Your answer
Follow this Question
Related Questions
Rotate object 1 Answer
rotate object around another object 1:1 1 Answer
How do I rotate an object to the cursor?Where is the mistake in the code? 1 Answer
Joystick Rotation with Transform.RotateAround 0 Answers
How can I make the gun rotate and shoot like lost control and shooting all around ? 0 Answers