My CrashDetector script is not working properly

Hi Monstertank,

Could you please share screenshots of the problem in Unity?

Actually, Rick’s Barry should have dived into the ground instead of bouncing off. In later videos, you can see, that he doesn’t bounce anymore. Rick suspects that the surface effector made the head bounce in this case. Sometimes, there are undesired side-effects, and since we didn’t write the Collider2D classes or the surface effector class ourselves, we cannot prevent those side-effects.

If you prefer the head to bounce, you could uncheck “is trigger” in the Collider2D component. In your code, you would have to use the OnCollisionEnter2D method instead of the Trigger method.

Did this help?


See also: