# Collision response is to slow.

This topic is 3552 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi folks! In my FPS Game i have this tactic for my Collision Response (sliding walls). 1 Find the closest Point on any of my wall. 2 If any of these points is closer than 2 (Radius of my sphere) 3 Push the player out as far as the sphere "overpenetrates" the max distance allowed( in this case 2 as radius) Example: Min Distance to wall is 2. if DistanceToWall < 2 PushPlayer out formula: VPushout = (2-ActualDistanceToWall) * NormalizedNormalVector Of That wall S THIS RIGHT? BECAUSE THE PLAYER CAN COME TO CLOSE THE WALL ANYWAY. My MoveVector that has the speeds and direction that the player is traveling with is added with the Correction Move_v+=(2-ActualDistanceToWall * NormalizedNormalVector Of That wall). It feels like i am missing a step, i have to do some more checks and push the player out sooner. Because when the player slides with full speed i have a distance of 1.2 to the wall. When i Press "W" key the speeds are increasing and when letting go the speed decreases. The formula for my move vector is like this, the only thing i control is the speeds. vector vForward = camera.mview-camera.mpos * forwardspeed The Move_v = vForward + vBackward + vLeft + vRight (and so on) i can´t figure out why this isn´t enought to push the player out to the exact distance of 2 (radius) This formula is just doing the work like 70% or so depending on the speeds. (2-ActualDistanceToWall * NormalizedNormalVector Of That wall) If i just push the player slowly against the wall i endup 1.8 away from wall, but with full speed i end up 1.1f to the wall, so there must be something with the speeds i am missing. Anyone have a formula for pushing the player out with the Wall Normal and the penetrated distance?

##### Share on other sites
Problem solved!

I forgot to update length to wall after pushing player out of the wall.

No the player ALWAYS has exactly the distance of my radius to any walls, obtuse or not obtuse!

1. 1
2. 2
Rutin
22
3. 3
JoeJ
18
4. 4
5. 5

• 15
• 40
• 23
• 13
• 13
• ### Forum Statistics

• Total Topics
631725
• Total Posts
3001905
×