New answers tagged

0

So I decided to use rigidbody and some box colliders to restrict player movement. Overall I think it's the best solution for this case. I used Box colliders 2D as bounds and to detect a ship of a player. I also set Rigidbody2D for a ship. It's also important setting continuous collision detection in Rigidbody properties for the ship of a player, so the ship ...


0

The fastest fix would be to first check if your new position is out of bounds before clipping it to the bound in case it is bigger. void Update() { moveX = Input.GetAxis("Horizontal"); moveY = Input.GetAxis("Vertical"); Vector3 currentPosition = transform.localPosition; Vector3 futurePosition = currentPosition + new ...


0

I tend to develop in 2D, but your question seems more functional-based so I might be able to help, hopefully. Maybe this approach is a little naïve, but perhaps try post-incrementing the movement of your player-character by an incremental amount when you change direction on the Keypress/D-Pad. This will smoothly move your player character in the scene, ...


Top 50 recent answers are included