Author Topic: [solved]Scroll List not scrolling between elements  (Read 2363 times)

rav3n256

  • Guest
[solved]Scroll List not scrolling between elements
« on: March 28, 2013, 07:34:14 PM »
Given a clipped panel scroll list, each of the elements in the scroll list contains a collider and the UIDragPanelContent script.  If there is space between the elements where the collider doesn't encompass, the drag panel script won't function, which makes sense.  What do I need to do to make sure that doesn't happen besides making the elements tightly packed together?  I tried adding a collider and UIDragPanelContent to the grid of elements, but with little success.  Any input would be appreciated.

Cheers
« Last Edit: March 31, 2013, 11:07:12 AM by Nicki »

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Scroll List not scrolling between elements
« Reply #1 on: March 29, 2013, 09:38:52 AM »
Make a scroll collider gameobject, which just has a collider and a UIDragPanelContents. Set the collider to fill the entire scroll area, and remember to put it outside the actual scrolling panel. Set it's depth to be below the other buttons you have in the scroll panel, so that any clicls that "slip through the cracks" hit that instead.

rav3n256

  • Guest
Re: Scroll List not scrolling between elements
« Reply #2 on: March 29, 2013, 03:51:04 PM »
I've actually tried that as well with no success.  I assume this depth for this newly created gameobject is just physically moving it back behind the buttons.  I debugged the UIDragPanelContents to see if anything is being called when I drag/click/something, surprisingly, nothing is being called even though I'm clicking in the collider.  Here's the layout of setup:

object (collider + UIDragPanelContents )
dragPanel (UIPanel + UIDraggablePanel)
->Grid
-->Item1 ( UIDragPanelContents + collider )
-->Item1 ( UIDragPanelContents + collider )

Any input is appreciated. Thanks.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Scroll List not scrolling between elements
« Reply #3 on: March 30, 2013, 08:17:32 AM »
Is your "object" properly referencing your dragpanel as the DraggablePanel?

Is the collider properly sized? Remember that the collider takes into account the transform scale as well.

Try putting a script with an OnClick on that object and ses if you hit it at all.

Make sure you are in the correct unity layer. (see in top left, if you use something other than default for your UICamera, then that should be the layer used).

rav3n256

  • Guest
Re: Scroll List not scrolling between elements
« Reply #4 on: March 31, 2013, 05:46:55 AM »
Hey Nicki,
many thanks.  It was the layering that was causing the widget from not receiving inputs.  Every time I created a new GameObject, I completely forgot to switch the object to the correct layer before dropping and using it under the UIRoot object.  Again, many thanks.

Cheers