How can i have my caracter not go off screen?

Hello i have a caracter that moves around using the iphone accelerometer. when my caracter moves off the screen can i have it come back. so is there a way if i tilt right and my caracter goes right and off the screen can it come back on the left side of the screen and contine to move right?

The simplest way would be to use a character controller to move the player and have colliders on the sides of the screen.

Could also check if the new position is inside or outside. Depends of you’re camera type.