Support => NGUI 3 Support => Topic started by: UltraTM on January 10, 2015, 10:53:01 AM
Title: error CS0029: Cannot implicitly convert type `void' to `UnityEngine.Collider'
Post by: UltraTM on January 10, 2015, 10:53:01 AM
Hello,
i hope someone could help. I bought an Asset which has no support anymore cause no one answers :( Hope someone could help fixing the Error:
UIDimmer.cs(55,33): error CS0029: Cannot implicitly convert type `void' to `UnityEngine.Collider'
line 55 is : mCol = NGUITools.AddWidgetCollider(gameObject);
Added file as Attachment
Title: Re: error CS0029: Cannot implicitly convert type `void' to `UnityEngine.Collider'
Post by: Nicki on January 10, 2015, 05:48:42 PM
NGUITools.AddWidgetCollider doesn't return a collider anymore because of the optional 2d colliders instead. You just have to grab the collider yourself like so:
Change the lines
mCol = NGUITools.AddWidgetCollider(gameObject);
mCol.enabled=true;
to
NGUITools.AddWidgetCollider(gameObject);
mCol = GetComponent<Collider>();
mCol.enabled=true;
Title: Re: error CS0029: Cannot implicitly convert type `void' to `UnityEngine.Collider'
Post by: UltraTM on January 11, 2015, 06:26:44 AM