This must be a solved problem that I am failing to GoogleFu.
I’m learning Unity and building a simple model for a 2D puzzle game using the Unity’s physics engine. Right now, I’m having a problem with collisions being/looking precise.
When my player object, a black square, collides into the walls of the arena (four rectangles forming a square arena), the player tends to penetrate slightly before bouncing out. It’s slight, and I’ve played with the “min penetration settings” but it’s noticeable and quite annoying.
I’ve been playing with the 2D Slider Joint to create a platform that can slide along an axis. When my player collides into this platform along an axis that the slider joint shouldn’t move in, the joint/platform bounces.
For example, if my player is falling from top to bottom along the Y-axis, and the platform is constrained to move along the X-axis only, it’ll slightly shift along the Y-axis upon collision. What’s worse, it won’t bounce back and will continue to play out in its shifted position. When the player object falls off (say, gravity shifts to push it from bottom to top), the platform will jump back to its original position.
Again, pretty aggravating.
Are there any ways around this? Should I just be blowing up the size of my arena/player character so that these effects are less noticeable? Perhaps I’m playing with small units (My player character is 0.5 units large) so the effects are pronounced?
Or is this just something flawed with Physics systems or Unity’s physics system? In this case I’ll have to create my own physics system/movement system and that just seems really unfortunate for such simple cases.