Function OnCollisionEnter is not working properly in C#
Hello, squirrelfriends! Today I'll be writing about one of the things I've done in Unity: specifically, coding my own collision detection using certain aspects of Unity's physics, and simple maths & physics (for Recess Race!). Why not just use Unity's physics? Good question! The short answer is Unity's physics are meant for 3D movement, and they're great for that. Function OnCollisionEnter is not working properly in C# because their basic character controller uses a capsule collider. It's pretty essential for 3D, but it doesn't work for classic SNES era 16-bit platformer tropes. Consider this image: Wile E. Coyote wishes he could do this Now, that's not realistic. You can't stand like that! but it makes sense when you think about the strictly-rectangular collision detection they had at the time. It was a hardware/software restriction but they ran with it and made the restriction into an asset. Here's the same image with an approximatio...