Best way to have Game Boundaries using "Translate to move"

Hey gang just wondering the best way to implement game boundes the player cant go past while using translate to move, since collisions do not work with translate :slight_smile:

There are several ways you could do this, but the one that makes most sense probably still uses collision. You can attach colliders marked as triggers to your moving object and boundaries, and within your custom movement check for any of the OnTriggerEnter callbacks and handle the case accordingly.

You could alternatively, or even in conjunction with the OnTriggerEnter logic, insert raycast checks into your movement code and only allow movement in valid directions where the raycast has ensured there is still room to move.

Alternatively, depending on your game you could even use a simple distance check from an arbitrary starting point, and consider anything outside of a defined range outside of the boundaries.

Without knowing the requirements of the game it is a very vague question, but there are a slew of options out there even if you are not using the built-in physics. It comes down to what makes sense for your game and what is practical.