How get refrence position game object use transform position when use local tool handle rotation

When using the rotation handle tool locally, we can adjust the game object’s position based on its rotation.

When we use transform.position it only changes the game object’s position based on the global. But I want to change it based on the moment just like we use tool handle rotation locally, not globally.

How do I get and change it in the script?

You can use

 transform.localPosition = SomeVector;

to change the local position of an object.

If the question is how you can get the local directions then you can use either the preformatted axes:


which contain the corresponding local axes of the object transformed into global coordinates.

Apart from that you can always use transform.TransformVector and transform.InverseTransformVector to transform vectors between local and global coordinate space.