Stop Moving during screen fading in & out

Hey guys,

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.

Thanks!

Got it… after 2 days hahaha :smile: Thx! Can I or someone (mods?!) delete this post?

Is typically polite to post the answer instead of deleting.

Anyway the first thing that comes to mind would simply be setting timescale to 0 during the fade.

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>();