Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: lofl on July 31, 2013, 02:11:18 AM
-
Hi,
I try UIDraggablePanel like Example7.
But gameobject under UIGrid could not drag.
My Hierarchy is ...
+Panel (Clipped and has UIDraggablePanel)
+UIGrid
+GameObject (has Collider and UIDragPanelContents)
+UISprite
If Sprite has Collider and UIDragPanelContents directly, it works.
How can I work it like Item1 in Example7?
Thank you.
-
How did you add the collider? When adding the collider you should use the NGUI shortcut -- either via the NGUI menu or by hitting ALT+SHIFT+C.
-
I add collider using NGUI->Attach a collider.
-
Then that's fine. Be sure to remove the collider from the sprite and ensure you don't have any other colliders blocking the way.
-
Sorry for reply late.
I ensure collider, but there is no blocking collider.
I add sprite under UIGrid. it works.
Then I create empty game object and move sprite under this.
I add collider and UIDrag Panel Contens to game object instead of removing its from sprite.
This doesn't work.
-
Most common cause: wrong layer.
When you create a game object -- I assume you are doing it using "new game object" it adds it to the Default layer. ALT+SHIFT+N adds a child game object under the correct layer.
Also what do you mean by "instead of removing its from sprite"? If you add a collider to the parent, you should remove the collider from the child as it makes no sense to keep it. Only one collider can receive events, not both.
-
It worked well.
Thank you!