- Home /
Question by
SteelArrow21 · May 05, 2014 at 12:07 AM ·
rotationunity 2dtranslatevector2turn based
C# 2D Translate Forward Based on Rotation
I did some research on this, but i could never find an answer for 2D. I tried using a line of code for 3D Objects:
transform.Translate ((transform.up) * Time.deltaTime);
It goes along the X and Y axis like I want, just not in the right direction. How would I go about translating a 2D sprite forward based on its global rotation?
Comment
Best Answer
Answer by Deign · May 05, 2014 at 04:28 AM
Use transform.forward http://docs.unity3d.com/Documentation/ScriptReference/Transform-forward.html
Your answer
Follow this Question
Related Questions
How can I translate a Vector2 control system to Vector3 and rotate? 1 Answer
Why Use InputManager over the easy transform.Translate? 1 Answer
Look Where You're Going 3 Answers
How could I emulate a cherry picker arm's rotation? 0 Answers
Unity 2D movement and rotate sprite to the direction it is moving in 1 Answer