Quantcast
Viewing all articles
Browse latest Browse all 2891

Compiler telling me raycast.collider is obsolete

In my code I have: Collider2D playerFinder = Physics2D.OverlapCircle (transform.position, 5f, playerdetect); if (playerFinder.collider != null) { On that second line I am getting the error message: 'UnityEngine.Component.collider' is obsolete: 'Property collider has been deprecated. Use GetComponent() instead. (UnityUpgradable)' But I'm clearly not trying to get a collider component, I'm trying to access the result of the OverlapCircle. I have used the same method elsewhere, infact on the next few lines and yet I'm not getting errors for that. I got this error yesterday too and had to resort to using a OverlapCircleAll even though I didn't want to... Am I doing something wrong or is this a bug?

Viewing all articles
Browse latest Browse all 2891

Trending Articles