Log in or register to post comments

Transform world space to local

March 29, 2012 - 6:24am #1

Hey!

I am dealing with touching and dragging the object.

Since my Game object is a child of another, I always use localPosition to move it according to the parent object.

But when I want to drag the object, I need to convert the touch inputs x & y to the localPosition. I mean that, when I touch the somewhere on the parent object, it returns the global position. If I use these global position, my object goes somewhere meaningless

I know Transform.Point to convert local to world, is there any method for reverse operation ?

Re: Transform world space to local

March 29, 2012 - 12:37pm #2

The Scripting Reference is a very useful set of pages. Also you can post at answers.unity3d.com. But this is where you should spend some time: http://unity3d.com/support/documentation/ScriptReference/Transform.InverseTransformPoint.html

Log in or register to post comments