So I made a sphere and I am trying to check if I am colliding with this sphere. I am using this code
function BallControllerColliderHit(hit : ControllerColliderHit)
{
if(hit.gameObject.name == “dodgeball”)
{
hit.gameObject.animation.Play(“ball_spin”);
}
}
Pretty much does not work. The animation works because I have it play automatically and it spins my ball, so thats not the problem. I have attached this script to my player which was a “First Person Controller” but it is not working. I have also used print(“Collided with Ball”); in place of the animation and that did not work either but I can not think of anything wrong with the conditions… And the sphere is tagged “dodgeball” correctly.