Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: rganeyev on February 04, 2013, 09:36:52 AM

Title: colliders out of panel can be pressed
Post by: rganeyev on February 04, 2013, 09:36:52 AM
I have a scrollview, made by panel with clip range and buttons in that scrollview. Every button has a collider, as shown in picture.
(https://dl.dropbox.com/u/16053956/collider.PNG)
The problem is that colliders could take touches out of panel. If you'll tap or swipe in the left of panel in place where orange gizmo is drawn, collider of item0 will take touch.

I made this by looking to scrollview panel example, but in example there's no that behaviour. It seems that I forget to do something. Please, tell me what's my mistake?

Title: Re: colliders out of panel can be pressed
Post by: dlewis on February 04, 2013, 06:46:08 PM
The example has colliders on the outside of the clipping area to stop touches to invisible objects. Make sure the blocking colliders are in front of the objects you want to block.
Title: Re: colliders out of panel can be pressed
Post by: ArenMook on February 04, 2013, 07:46:54 PM
There is an option on the UICamera to clip colliders ("Clip Raycasts"). Turn it back on.
Title: Re: colliders out of panel can be pressed
Post by: rganeyev on February 05, 2013, 01:09:05 AM
Couldn't find "Clip Raycasts" option neither property like it on UICamera. Is that new feature or maybe it's not on UICamera script?
Title: Re: colliders out of panel can be pressed
Post by: lime-green.at on February 05, 2013, 02:49:39 AM
(http://s3.imgimg.de/uploads/Capture050a3b90PNG.png)

If you cant find it in the inspector, turn it on by script:
  1. cameraGO.getComponent<UICamera>().clipRaycasts = true;
Title: Re: colliders out of panel can be pressed
Post by: rganeyev on February 05, 2013, 02:55:35 AM
it seems that I have outdated version of ngui(2.2.2), that's why there's no such field in UICamera.
Thx for help!
Title: Re: colliders out of panel can be pressed
Post by: lime-green.at on February 05, 2013, 03:04:19 AM
Here's how to update your ngui version: http://www.tasharen.com/forum/index.php?topic=1440.0
Title: Re: colliders out of panel can be pressed
Post by: rganeyev on February 05, 2013, 04:14:45 AM
Thank you for help!