I have a ball moving like this:
⚽
⭩
|‾‾‾‾‾‾|
Let's suppose its velocity is (-1, -1). When it collides with the ground, its velocity should be (-1,1), since it will keep going left but it will start going up (considering gravity is not necessary).
The normal vector of the collision is (0,1).
What happens is when I use Vector2.Reflect(velocity, normal)
, instead of returning (-1,1), it returns (1, -1).
What I want What it returns
⚽ ⚽
⭦⭩ ⭩
|‾‾‾‾‾‾| |‾‾‾‾‾‾|
⭨
Seems like it's reflecting over the normal vector (1,0), but it is not. What am I doing wrong?