Page 1 of 1

Push player out of ground

Posted: Fri Aug 30, 2013 10:08 pm
by Spykam22
Hello! I noticed that when an object is collides or is stuck inside another physics object, it pushes itself out of it. Example: a box is on the ground but part of it is in the ground so it pushes its self up and out of the ground. I would like to increase the effect of this so it pushes out really fast. How would I do this? Thanks :)

Re: Push player out of ground

Posted: Fri Aug 30, 2013 10:38 pm
by Norbo
Increasing CollisionResponseSettings.PenetrationRecoveryStiffness and CollisionResponseSettings.MaximumPenetrationCorrectionSpeed would do it.

If your objects are larger than the default settings are tuned for, then the latter one is probably the most important. In this case, you may also want to check out the demos ConfigurationHelper.ApplyScale function. It adjusts the behavior of a lot of different tuning variables proportional to a scaling factor.