This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

I'm working on a project that has player control but heavily uses AnimationPlayer Nodes. Is there any way to remove the script while this animation plays and then return it at the end?

in Engine by (101 points)

1 Answer

+1 vote
Best answer

I believe this can only be done through a function or variable created manually under the kinematic body's node.

Modify your input code so that the body only takes inputs when another variable is true.

The way I structure my projects s to have a function handle all the inputs on the player, so I would just adjust the code under physicsprocess so look like:

if controllable:
  get_input()

Then if in the animation player you change the variable controllable between true and false, you should be able to add or remove control from the player, while also letting the rest of the necessary scripts run.

by (399 points)
selected by

^This
If you export the variable you can even key it through the inspector.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.