If I set a sphere’s physics material restitution to around 1.5 and drop it onto the ground from a few meters, it will bounce a couple times losing some steam each bounce, but then around the 3rd time it stops even though it’s clearly high enough to keep going. Once I set the restitution to around 2 each subsequent bounce is higher than the last so in this case it keeps going. Seems like once the velocity goes under a certain threshold there’s no bounce? Is this a bug or am I doing something wrong?
I know that when you use a
UProjectileMovementComponent there is this value:
and this sounds like what is happening to you.
However, I don’t know anything about this “sphere” of yours. If this isn’t the issue, it would be helpful if you could explain your spheres settings/components a bit more. =)
I did try messing with a projectile component. I set the Bounce Velocity Stop Simulating threshold to 0 and removed the physicsMaterial but I still get the same behavior. My projectile physics settings:
If I remove the projectile component and add the physicsMaterial with restitution, I still have the same behavior. My physicsMaterial settings:
My sphere mesh physics settings:
I’m really just trying to make a billiards game and I want the pool table cushions to have the bouncy physics material. I was witnessing the same behavior. If a pool ball hit the wall under a certain velocity, it didn’t bounce back. It’s just an easier test to simulate dropping a ball. Even if I set the floors physics material, same behavior.
Need Staff Assistance =)
Well, I’ve done several tests using similar things that you have, as well as some ideas I had, and I am getting the same result. It bounces nicely until it is about 10 - 30 units off the ground, then on the next collision with the floor, it just sticks to it rather than doing several little bounces. This behavior is not ideal for billiards.
I’m sorry man, I don’t know what to tell you. Hopefully some staff can jump in and figure something out.
The only alternative that I can think of would be to only use the physics materials for friction, and apply the bounce forces manually. This will be tedious and probably time consuming.
On collisions, you could do a line cast from the ball in the direction of the velocity, do some trig calculations to get the deflection angle, add in the modification due to ball spin (if you are doing that) and then apply a force in that direction based on all that, the balls current velocity, and the balls mass. If you collide with another ball, you will need its mass, velocity, and spin as well.
You could make a struct in a
BilliardBall class with properties about the ball:
- Angular Velocity
and just keep it updated. Then on collisions you could just access those values to help you calculate.
Specific implementation is up to you if you decide to go that route.
Again, I’m sorry I couldn’t be more help.
Not a problem, I appreciate you trying to help and yes, hopefully some staff can chime in. I was afraid I’d have to resort to coding some physics myself but at least I’ll learn some new things: ) Thanks!