#How can I make my character unable to move during the animation?
1 messages · Page 1 of 1 (latest)
i do this by having a variable in an autoload script that determines whether or not the player has control over the character. can be as simple as just wrapping the code for character control (inputs specifically, unless you want the character to freeze in place) in something like this
if player_has_control:
pass # insert input/movement related code here
How can I do that? sorry I'm still a newbie
in the project settings menu you can use the "Autoload" tab to set scenes or scripts to be loaded and globally accessible at all times. though in this case if this is the only scenario you want player control to be locked (just during a scene transition it seems) you could actually just have the variable on the character script itself and set it with the transition area's script (you're already checking for if body.name == "CharacterBody2D", so you could also set a value on body like body.player_has_control = false)
It is a transition between two places, so I plan to use the script on more than one occasion. In this case would it be better to import it in "Autoload"?