Hello, I have a terrain GameObject with an EdgeCollider2D and a Character GameObject with a Random Collider.
I want to find on which side of the EdgeCollider2D the Collision is happening on whenever OnCollisionEnter2D is called.
I wrote these 3 functions to kinda do this, but they are too slow (there is a ~3-frame lag spike whenever my GameObject collides with Terrain) and sometimes imprecise.
Is there any faster and more precise way for me to do this?
Edit: I have a small typo on the code at Pastebin, the first function is not supposed to have the ‘Alt’ at the end…
Example image: