Optimal way to get high speed collisions

Hey, I am looking for a way to efficiently know if my character has been thrown against a surface with enough force. Raycast has shown to be not accurate, and checking the HRP.Velocity has also been a failure most of the time.

The goal is to know if the character has been thrown against a wall with sufficient speed to create debris (that is handled by another code).

1 Like

When you say HRP.Velocity did not work, did you just use the velocity? Or did you get the speed as well using HRP.Velocity.magnitude

If this didn’t work try checking the speed of the player constantly and then if the player touches a surface at the required velocity, add the particles rather than just on impact because by the time the script will have found the speed of the player, it will be 0 because the player has already hit the surface and stopped, all this happening in nanoseconds.

You could always add a loop to track track your character’s velocity at anytime. Then if the speed hits zero, or below a certain threshold, trigger your ‘collision’ code.

Perhaps, if the difference in speed change is greater than a threshold, as you don’t want to trigger collisions of your player is only slowing down.

The best way to get high speed collisions is if you set network owner to the player who is hitting the parts. That way your computer is calculating everything so it looks extremely smooth.

1 Like