I’m really new to Unity, so bear with me please.
I have an object in my scene that is controlled by the user (using WSAD). The object is a sphere, and it’s inside a rectangular enclosure. I want to know of there’s a way I can prevent the sphere from going outside the walls of the enclosure, but still be able to control the movement of the sphere with WSAD.
Making the walls into mesh colliders and making the sphere a rigidbody didn’t work, but I’m not really sure what I’m supposed to do