Quantcast
Channel: Questions in topic: "ignorecollision"
Viewing all articles
Browse latest Browse all 148

Ignore collision failed. Both colliders need to be active

$
0
0
I instantiate a ball in a gameObject script of a character so that the character has a ball to play with. I try to ignore collisions between the ball and the gameObject and when I do I get this error. Ignore collision failed. Both colliders need to be activated when calling this IgnoreCollision ball=Instantiate(Resources.Load("Sphere")); ball.name=gameObject.name+"ball"; ball.rigidbody.isKinematic=true; ball.rigidbody.useGravity=false; ball.GetComponent(SphereCollider).isTrigger=false; Physics.IgnoreCollision(ball.GetComponent(SphereCollider),gameObject.GetComponent(SphereCollider)); Is this happening because something is not fully loaded? How do I fix it?

Viewing all articles
Browse latest Browse all 148

Trending Articles



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