0
\$\begingroup\$

No collision detected with 2D rigidbody 0 I have a ZombieBoy with a circle collider2D and a box collider2D and a RigidBody2D . The player shots energy balls which has a Circle Collider2D and a Rigidbody2D. It is set to trigger. But i have also tried without it set to trigger.

The ZombieBoy has this on its script

        void OnTriggerEnter (Collider other)
       {
          Debug.Log ("Im hit! " + other.name);
       }

       void OnCollisionEnter (Collision collision)
       {

          Debug.Log ("Im hit! " + collision.gameObject.name);
       }

But i get nothing in the console, and no breakpoints react.

\$\endgroup\$
1
\$\begingroup\$

Should use:

void OnTriggerEnter2D (Collider2D other)
{
}
| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.