Support => NGUI 3 Support => Topic started by: lime-green.at on November 04, 2012, 02:08:27 PM
Title: "Attach a collider" - which function is called?
Post by: lime-green.at on November 04, 2012, 02:08:27 PM
Hey,
i need to attach a collider at runtime, but when i use the BoxCollider Component provided by Unity3d itself, the bounds aren't right. If i attach a collider from the NGUI Menu, it fits. So i need to know how to attach a ngui collider from script.
Regards
Title: Re: "Attach a collider" - which function is called?
Post by: nah0y on November 04, 2012, 02:58:15 PM
Hey,
Just a small research in the code told me :
NGUITools.AddWidgetCollider(YOUR_GAME_OBJECT);
Title: Re: "Attach a collider" - which function is called?
Post by: lime-green.at on November 05, 2012, 02:22:12 AM
Thanks for that information, i was searching for the keywords "collider", "box", ... etc., couldnt find anything.
Title: Re: "Attach a collider" - which function is called?
Post by: nah0y on November 05, 2012, 04:46:52 AM
No problem!
As the text in the menu is "Attach a collider", I searched "Attach" ;) Also, all of these utils methods are usually in the NGUITools script!