What's the best script to get the player go from the left and appear on the right of the screen

Need to ask for help guys.

I want the player when go to the left of the screen appear on the right. Like pacman when he goes to the left of the screen he would appear on the right.

Right now, I’m doing it by destroying the player and create another one on the right, but is there any better way to do this? One that not involve destroying the player?

I’m still a newbie,btw…

Don’t destroy the player, just directly edit the transform. This way, you’re not going to incur the cost of instantiating again. i.e.:

if (playerAtRightSide)
    player.transform = someLeftSideValue;

or do it with colliders.