- Home /
Move UI element towards direction it is facing
I have a text element which is rotated by some degrees. I want to move that towards the direction it is facing by some units in code.
This is what it looks like:
I want to move it a few units towards the direction it's facing so it looks like this:
Everything is contained in a Canvas and all thus all elements have a Rect Transform. The Rect Transform of the text in question for example has a rotation of -22 (in the z-axis).
I can only manage to move it in the x or y direction, but not in both in a uniform way. How can I do this?
Have you tried to use Translate ?
https://docs.unity3d.com/ScriptReference/Transform.Translate.html
Your answer

Follow this Question
Related Questions
Rotation speed,Rotate script slows down 1 Answer
Prefab instantiates with incorrect rotation. 0 Answers
how can i stop rotating gameobject but slowly 1 Answer
Rotation not working as expected 0 Answers
Why is this rotation acting odd? 0 Answers