Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: pretender on May 10, 2013, 09:07:11 AM

Title: UIDragObject
Post by: pretender on May 10, 2013, 09:07:11 AM
I was searching through the forums how to use UIDragObject on 3d objects but no luck. I managed to use UIDragObject
on widgets just by placing script on the widget with collider and setting its target. It does not want to play like that when dropping on simple cube. what i need to check? layers,event receiver mask,clip raycasts? i tried all combination that i could think of and what made the most sense but i can get it to work. I put collider on the object, UIDragObject and set its target.

i made a simple script with only function like this
  1. void OnDrag()
  2. {
  3.     Debug.Log("Dragging");
  4. }

so to let me know when it detected the dragging, but nothing happens

what i am doing wrong? thanks!
Title: Re: UIDragObject
Post by: ArenMook on May 11, 2013, 12:51:39 AM
OnDrag has a parameter you're missing -- it's a Vector2. Look at line 120 of UIDragObject.

I'm not sure why you wrote your own OnDrag function either. UIDragObject works as-is. You can see it in use in the "draggable window" example.
Title: Re: UIDragObject
Post by: pretender on May 14, 2013, 06:08:52 AM
ok i get it now, i did not put UICamera on the MainCamera. Now it works fine, i am just wondering why there is no Momentum effect when dragging object? Is there anything else need to be setup up?