Hi, I want to try to figure out how to make a ball, which in this case I’m using in the shape of a hockey puck, bounce off the wall at the same speed it’s going. The image clearly shows what I want to do: if the puck is going at 20m/s at a 30º angle, when it bounces it will go at the same speed but with the opposite angle.
2 Likes
local d = 20 -- starting velocity.
local n -- vector perpendicular to wall (normal), easy to calculate but feel free to ask.
local r = d - 2 * d:Dot(n) * n -- new velocity.
This could help?
Note that the velocity is a Vector3 or Vector2, nothing else.
1 Like
Hmm no thats only three variables, but I need more what do
What do you mean…? That’s all you need to do this…
1 Like