Is there a way to customize bounce behavior?
Posted: Thu Dec 20, 2012 10:16 pm
I'm having a bit of trouble with CollisionResponseSettings.BouncinessVelocityThreshold. If I set it high enough that objects stop bouncing on the ground as soon as I want them to, then objects which are flying at walls often simply stop and fall to the ground, or slide along the wall, instead of bouncing off the wall. The reason I'm trying to set BouncinessVelocityThreshold so high (around .3 to .5, with most objects in the sim scaled between .5 and 10 units) is that if I don't, objects continue to bounce very minutely for several seconds after they seem like they should have come to rest on the ground. This also makes on collision events which fire off things like sound effects not work very well, because the sounds trigger over and over again every few frames from the tiny, invisible bouncing. This behavior is probably mostly due to my setting the gravity vector at somewhere between -26 and -40 -- I'm leaning toward the latter to get a nice, non-floaty jump feel.
Anyway, I'm wondering if there's a way to provide the engine a new method for bounce response, or some way to distinguish between y velocity (vertical for me) versus x and z horizontal velocity for the purpose of bouncing response. If not, should I just check for the speed that things bounce on the ground with and dampen/remove their y velocity if its below a certain speed? Thanks a lot Norbo,
Alex
p.s. Also, I am aware I could simply limit bounce sound effects and graphical effects and whatnot to when a certain collision force of bounce with the ground has occurred, thus discounting the tiny bounces. The problem I have with this is that I have, for example, a creature I want to detect when it has completely stopped bouncing and then launch itself into the air again. So in other words, I am basing some AI behavior off of the bounce behavior, in addition to aesthetic effects.
Anyway, I'm wondering if there's a way to provide the engine a new method for bounce response, or some way to distinguish between y velocity (vertical for me) versus x and z horizontal velocity for the purpose of bouncing response. If not, should I just check for the speed that things bounce on the ground with and dampen/remove their y velocity if its below a certain speed? Thanks a lot Norbo,
Alex
p.s. Also, I am aware I could simply limit bounce sound effects and graphical effects and whatnot to when a certain collision force of bounce with the ground has occurred, thus discounting the tiny bounces. The problem I have with this is that I have, for example, a creature I want to detect when it has completely stopped bouncing and then launch itself into the air again. So in other words, I am basing some AI behavior off of the bounce behavior, in addition to aesthetic effects.