- Home /
Question by
gamedev098 · Oct 07, 2013 at 05:24 PM ·
rotationmovement
Spin while moving
Hi, I am working on a 2d game prototype. I have a GameObject which i want to spin and move at the same time.
if I do this, the object starts moving in a circular orbit.
transform.Rotate(new Vector3(0,0,1));
transform.Translate(new Vector3(1,1,0f));
I just want the game object to keep spinning(CW or A-CW) and move along a linear path. Is it possible?
Comment
@robertbu, please, could you convert your comment into an answer so @gamedev098 could accept it?
Best Answer
Answer by Sisso · Oct 07, 2013 at 05:35 PM
Try to change your object hierarchy where one object you move, and other you rotate.
obj
- Axis
- Model
axis.transform.Rotate(new Vector3(0,0,1));
obj.transform.Translate(new Vector3(1,1,0f));
Answer by robertbu · Oct 07, 2013 at 05:32 PM
transform.Translate(new Vector3(1,1,0f), Space.World);
Your answer
Follow this Question
Related Questions
Rotation used as movement 4 Answers
Joystick for WASD & Joystick for Camera? 0 Answers
3D Heat Seeking Missile (C#) - Odd problem 1 Answer