I would like to access or compute the green and/or red vectors used by the move tool in C#. In other words, I want the normal of a rectangular 2D object with any rotation.
Green: Unity - Scripting API: Transform.up
Red: Unity - Scripting API: Transform.right
And a bonus:
Blue: Unity - Scripting API: Transform.forward
2 Likes
And combining them with Unity - Scripting API: Transform.TransformVector will give you the vectors in world space (or rather TransformDirection to be precise).
Update: forget what I said (see below).
The vectors given by the properties I posted are already in world space. If you want the local space vectors for those arrows they would be Vector3.up
, Vector3.right
etc.
2 Likes
Thank you! I figured it was this simple.
You are perfectly right. I glanced over it and read Vector.up. My bad . I’ll delete my post as to not confuse future readers.
2 Likes