I am currently trying to use CompareTag to test for an object in an array set up from an overlap sphere to see if it this the player. My code is as follows:
var colliders : Collider[] = Physics.OverlapSphere(transform.position, explosionRadius);
for(var hit in colliders)
if(hit.rigidbody)
if(hit.CompareTag ("Player"))
rise=true;
else
rise=false;
however this doesn’t seem to be working, I think the key reason for this is although i understand how each separate part of the code works, I don;t understand fully HOW it works, and therefor how it works together. I have looked through all of the appropriate script reference pages but I still don;t fully understand. If anyone was willing to explain how each part of this functions and the key reason(s) it isn’t working I would be eternally grateful.