Hi, I am using my own collision/bouncing off stuff-code for a 2d game and just can’t figure this out for some reason… it seems quite simple.
Looking at the image I basically just want to rotate my triangular pawn object clockwise or anticlockwise depending on the angle (yellow) between vector N (red) and vector V (green) when we have a collision.
I can get close to the effect but it doesn’t seem to work 100%, especially not if the red N vector is pointing down where I will get a 180 or -180 angle result, and then I can’t get a consistent angle difference between the angle of V and N (e.g 45-180 or 45-(-180) would make my pawn rotate in opposite directions seemingly at random.
I am using the usual break hit result, if that’d be of value to know if anyone kind hearted would be able to help out. I’ve looked at all other answers here that I could find yet no luck.