Let's assume following setup:
Player can move along X/Y-plane. Z represents depth (for simplicity 0 is constant for depth).
Now I have player surrounded in the box with walls. How I can limit player movement so it will resemble classic 2D movement - when hit the wall movement just stops.
I've tried to add rigid bodies and such but I always get small wobbling when pushing against the wall or then physics pushes player on infinite movement on reverse direction.
How to make this work?
↧