Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: misterkeeter on May 27, 2014, 11:47:27 AM

Title: [Solved] How to set an object to drag when its created.
Post by: misterkeeter on May 27, 2014, 11:47:27 AM
Is there anyway to set an object to already be dragging when its spawned?  I create an object at the mousePosition on a click but I want it to act like a draggable item i have already picked up. The object already has a UIDragDropItem attached to it.
If I click on it again it works as expected but I'd like to set or fire OnPressed when I create it..
Title: Re: How to set an object to drag when its created.
Post by: ArenMook on May 28, 2014, 05:34:55 AM
A click event is press + unpress. If you unpress, you aren't dragging anything. In your case you should be doing it in OnPress (true), and set UICamera.currentTouch.drag to be your newly spawned game object.