Quantcast
Channel: Latest Questions by Techsuport
Viewing all articles
Browse latest Browse all 12

character collider colliding with another character collider

$
0
0

im using the characterController to move me(my players character), and my ai characters, and they will recognize collision with each other, but how do you reference the ai's gameObject that im colliding with to, in this case Destroy() the AI my Player collided with?

function OnControllerColliderHit(hit:ControllerColliderHit){ if(hit.rigidbody.tag=="Enemy"){ print("hit");//wont print Destroy(hit.gameObject); } }

how do i check if what i run into is my ai character tagged Enemy?


Viewing all articles
Browse latest Browse all 12

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>