Support => NGUI 3 Support => Topic started by: citizen12 on August 20, 2012, 10:59:09 PM
Title: OnDrag doesn't work correctly when UIRoot.Automatic is false
Post by: citizen12 on August 20, 2012, 10:59:09 PM
I have a setup where my UIRoot Automatic checkbox is OFF. I am also using an OnDrag handler similar to DragDropItem where I use the delta parameter to update my object's localPosition:
mTrans.localPosition+=(Vector3)delta;
The problem I am seeing is that the drag is being scaled by a multiplier that causes the item to move further than the total number of pixels i have moved the mouse pointer. When I have moved the mouse 2 pixels the underlying object has moved 3. When I have moved the mouse 50 pixels, the underlying object has moved 60. At 100 it's about 150.
When I check the Automatic setting in UIRoot, the movement works correctly and the underlying object moves exactly the same amount as my mouse movement.
Title: Re: OnDrag doesn't work correctly when UIRoot.Automatic is false
Post by: ArenMook on August 21, 2012, 12:29:23 AM
This is correct. OnDrag is always in pixels. You have to adjust by the UIRoot's size yourself if you want it to be relative to the UIRoot's size property.