Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: albert on December 24, 2013, 04:52:32 AM
-
Hello,
I'm using NGUI 3.0.7 f3 and have problems when I use box collider.
I've got a clean scene, create a sprite and create a label as a child to make a button. When I Attach a box collider to the sprite it takes the same size, until here all ok.
When I play the game, the console show that errors:
Invalid parameter because it was infinity or nan.
UnityEngine.BoxCollider:set_center(Vector3)
NGUITools:UpdateWidgetCollider(BoxCollider, Boolean) (at Assets/NGUI/Scripts/Internal/NGUITools.cs:292)
UIWidget:ResizeCollider() (at Assets/NGUI/Scripts/Internal/UIWidget.cs:571)
UIWidget:OnValidate() (at Assets/NGUI/Scripts/Internal/UIWidget.cs:681)
UISprite:OnValidate() (at Assets/NGUI/Scripts/UI/UISprite.cs:293)
and that
dest.radius>=0.0f
UnityEngine.BoxCollider:set_size(Vector3)
NGUITools:UpdateWidgetCollider(BoxCollider, Boolean) (at Assets/NGUI/Scripts/Internal/NGUITools.cs:293)
UIWidget:ResizeCollider() (at Assets/NGUI/Scripts/Internal/UIWidget.cs:571)
UIWidget:OnValidate() (at Assets/NGUI/Scripts/Internal/UIWidget.cs:681)
UISprite:OnValidate() (at Assets/NGUI/Scripts/UI/UISprite.cs:293)
It get solved If in the UIsprite, I desactivate the checkbox "Box Collider : Auto adjust to match".
Is someone having the same problem?
Thanks!!
PD: Sorry for my english :$
-
Are you sure you have 3.0.7 f3? That problem was fixed and does not exist in f3.
-
Hi ArenMook!
For sure I'm using f3, at least it came with a txt that start with:
----------------------------------------------
NGUI: Next-Gen UI kit
Copyright © 2011-2013 Tasharen Entertainment
Version 3.0.7 f3
http://www.tasharen.com/?page_id=197
support@tasharen.com
----------------------------------------------
And donwloaded the files thesame day, hehe :).
I saw in another post that this was solved in that version, that's why i was surprised about this issue :/
-
Then I need some more clear steps to follow because I am not getting this by doing the following:
1. New scene.
2. ALT+SHIFT+S to create a sprite.
3. ALT+SHIFT+L to create a child label.
4. Select the sprite, ALT+SHIFT+C to add a collider.
5. Hit Play.
-
Hello ArenMook,
Thanks for your answer, from it I have find were it crash :).
If i follow your steps, and have an atlas and a sprite seleted for the UIsprite it works fine.
The problem comes when i don't use an atlas because i only use the UIsprite as a hit zone, if i don't select any atlas and let it to "none" then shows the error.
I'll use the box collider on the UIlabel instead than using it on the UIsprite.
Thanks a lot!
-
You should use an invisible widget for hit zones, not sprite. (ALT+SHIFT+W)
-
Aww! Great!
That's what I'll do :)
Thanks!