Author Topic: button in scrollView click bug  (Read 2875 times)

wangzy_88

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 33
    • View Profile
button in scrollView click bug
« on: March 22, 2015, 10:19:35 PM »
I use scrollView like this:
GameObjectA has UIDragScrollView and boxCollider.
GameObjectB under A has UIScrollView and UIPanel.
GameObjectC under B has UIGrid.
Two buttons under C has boxCollider,UIDragScrollView and MyClickFunction.

When buttons scroll to top,can drag but can't click,when scroll below panel's middle,can drag and click.
I change one button's boxCollider center's z to -1,two button can click.

I really don't know why,is positions error?

wangzy_88

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 33
    • View Profile
Re: button in scrollView click bug
« Reply #1 on: March 23, 2015, 12:27:15 AM »
I find a way to solve this problem,add UIWidget script to GameObjectA,even disable this component,click function will be called.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: button in scrollView click bug
« Reply #2 on: March 23, 2015, 09:56:02 AM »
Your UICamera needs to be set to 2D UI, not 3D UI. All colliders inside the scroll view also need to have UIDragScrollView attached.

wangzy_88

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 33
    • View Profile
Re: button in scrollView click bug
« Reply #3 on: March 25, 2015, 01:12:21 AM »
Thank you very much.EveryThing is right now.