- Home /
How to prevent my collider from overlapping/going into another object?
I am trying to prevent this (the wooden platform should is a solid box collider):
![alt text][1] [1]: http://i536.photobucket.com/albums/ff328/reeda1283/ScreenShot2013-09-10at122042PM.png
The player (the screaming guy) has a sphere collider, and the platform (the wooden one) has a VERY tall box collider (to safeguard against passthrus). The player ALSO has continuous collision detection, the DontGoThroughThings.cs script, and is set to Interpolate.
The player is slamming into the ground at very high speeds (that is the only real gameplay), and while with the setup above he never actually goes completely through the ground, he does go into it (as pictured), and its especially noticeable as there is a slowdown affect applied when he gets close to the ground.
I know this is most likely cause because interpolate is updating the player's position before the physics can detect a collision, but without interpolate the player's fast movemements looks extremely jerky and horrible.
So... how can I fix this? I need the sprite to never appear as if it's gone through the ground.
edit I should have mentioned this, but I have also tried messing around with the timestep, and even at 60 + Fixed updates per second the issue occurs. It's almost not even a physics problem, but more of a problem with Interpolation, since at slowed down speeds Update(), which controls position with interpolation on, will run far more often than fixedUpdate allowing the position to be "interpolated" as in the ground before physics kicks in.
Answer by napalm44 · Sep 13, 2013 at 02:46 AM
Changing Time.fixedDeltaTime
to run at a faster clip will pretty much resolve any issues you experience when time is slowed down. The issue will still occur at fast speeds at a time scale of 1.0, but will be probably be not noticeable as the speeds required will be pretty high.
Your answer
Follow this Question
Related Questions
How to make kinematic platform trigger events 0 Answers
Way to find Default Behavior Mode of Physics through Script 1 Answer
Instantiating Sprites 1 Answer
When I rotate a prefab, only the collider rotates, the mesh is not 0 Answers
What the heck in going on? after 2.36 seconds the code just stops 1 Answer