- Create a boolean right after the first line of your playerMovement script:
var playerIsTeleporting = false;
- Create an if statement right after the first line of the update function of the playerMovement script:
if (playerIsTeleporting) {
return;
}
- Set the boolean to true right before teleporting:
playerIsTeleporting = true;
- Set it back to false right after teleporting:
playerIsTeleporting = false;