I am trying to develope that my character can not move during screen fade in and out. You know it from retro RPGs. You leave a room and will be warped back to the city. Both maps are in the same scene; I’ve using trigger colliders for warping and setup a fade in and out. But during the fade you can move your character. This shouldn’t be. How can I stop moving my character easily? The fade in/out script is on an image (canvas). It would be perfect if I could stop moving inside the screenfader script.
Oh yea, sure. I failed because I setup the moving script twice on my character. One script was disabled through the screenfader script. And I don’t saw it… xD
Code was right from the beginning. I used:
player.GetComponent<Animator>().SetBool("iswalking", false); // set walking animation back to idle
playerControls.enabled = false; // you can not move
only for your information:
player = GameObject.FindGameObjectWithTag("Player");
playerControls = player.GetComponent<Player>();