How the heck do I get my ball to stop bouncing?

wow… well now i just feel emasculated :rofl: :rofl:

Dude thanks so much it’s working and it bounces of really nice too!

Could you could just explain it a bit more cause I really want to try to understand what the heck is goin on

yeah, i got you.

the main variables in my script are:

ballVel, the current ball velocity at any given moment.
coeffRest, the coefficient of restitution (CoR), the amount of velocity lost from a collision
grav, world gravity, 9.807 m/s

just like you did i set up a renderstepped and took the time passed as variable delta. every renderstepped i cast a ray in the direction of the ballVel with the magnitude of the ball’s radius. if theres no collision detected with the raycast the balls velocity gets gravity subtracted from it scaled with how much time has passed. if there is a collision, the ball’s velocity gets updated to go in the direction of the collision using the ray’s normal. a normal is a unit vector (vector with a magnitude of 1) in a direction of a face. i multiply it by the magnitude of the ball’s current velocity multiplied by its CoR to make it lose speed on collision.

no matter what happens, afterways the ball’s CFrame is itself + a positional update of its velocity multiplied by how much time has passed.

if you’ve anymore questions feel free to shoot me a dm on the devforum :+1:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.