Author Topic: UI Root intercepting events  (Read 2880 times)

Hafax

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
UI Root intercepting events
« on: October 01, 2015, 04:50:36 AM »
Hi, I'm trying to make a very basic UI

I have made the UI Root by pressing the NGUI tab -> create -> 2D UI

Then I have made a panel (panel 1), which has another panel inside (panel 2) which has a scrollview.
And in panel 2 I have a a widget with a BoxCollider and a UI Drag Scroll View script.

But when I try to drag it nothing happens, and the OnDrag event is never called in the UI Drag Scroll View script

The UI Root's layer is set to default and the panel has the layer UI.

The Camera created with the UI Root has the event mask set to UI.

But it seems when I turn on debug on the Camera, that I'm still getting OnHover event on the UI Root, even though it's layer is default and the Event Mask is set to UI.

Raycasts Hit Triggers is set in both Physics and Physics 2D settings

Am I doing something wrong? And if so could you point me in the way of a fix? Any help would be much appreciated.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UI Root intercepting events
« Reply #1 on: October 01, 2015, 05:46:34 AM »
Check your collider type and see if it actually maches the chosen event type on the UICamera. If you are using 2D colliders, you need to use a 2D UI event type. If you are using 3D colliders (regular colliders) then you need a 3D UI event type.

Hafax

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: UI Root intercepting events
« Reply #2 on: October 01, 2015, 05:49:58 AM »
This seemed to fix the issue. I would never have realised this myself... Thanks alot :) I was using Collider and had it set to 2D.
« Last Edit: October 01, 2015, 05:59:11 AM by Hafax »