Author Topic: [Solved] How to set an object to drag when its created.  (Read 2432 times)

misterkeeter

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 5
    • View Profile
[Solved] How to set an object to drag when its created.
« 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..
« Last Edit: May 28, 2014, 03:07:48 PM by misterkeeter »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How to set an object to drag when its created.
« Reply #1 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.