0 votes

Say I have an object (robot, guy, etc.) facing left.
I want him to appear "alive", so I play an "idle" animation where he stands there and be-bops, waiting for user input.
Now I press RIGHT - I play the animation of turning to the right. So far, so good...
Next, I set the object to spin to the right self.set_rotation(Vector3(0,deg2rad(180),0))
Finally, back to playing the idle animation in the animation player.
HERE'S THE PROBLEM:
Since the "idle" animation was created (in blender) facing LEFT, as soon as the animation player starts playing the "idle" animation, he's facing left again, not right as he should be.
QUESTION:
How do I rotate an object (around the Y) axis with an animation playing? Because it appears the animation player overrides anything you set in your scripts.
Thanks in advance for the help!

in Engine by (328 points)

I aint no expert but have you tried to place it on a 3d node(cant recall the name) and rotate its base? while the animation is on the actual model?

Just tried it. That totally worked. I put the entire deal as the child of a rigidBody and rotated the rigidBody instead and it works perfect!
You must be an expert ;)
Thanks!

Keep in mind everything you animate with AnimationPlayer can't be set by script or inspector afterwards, since it will override the values you give. You would want to animate a local transformation and set a parent transformation for scripting stuff, so they won't conflict with each other.

Please log in or register to answer this question.

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 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 webmaster@godotengine.org with your username.