godot icon indicating copy to clipboard operation
godot copied to clipboard

Animation player doesn't let update track properties

Open TadeoOrtiz opened this issue 1 year ago • 6 comments

Godot version

Godot 4 RC5

System information

Windows 10

Issue description

When I add a position track and add a keyframe to it, it won't let me move the node

https://user-images.githubusercontent.com/93532233/221439385-29453eb3-5de5-493a-aa7e-ea70dba97fdb.mp4

Steps to reproduce

Add to an animation from the animation player a keyframe of a property (position for example) and you will see that later it does not let you move it

Minimal reproduction project

N/A

TadeoOrtiz avatar Feb 26 '23 21:02 TadeoOrtiz

Can't reproduce. Can you make a minimal reproduction project?

KoBeWi avatar Feb 26 '23 22:02 KoBeWi

Looks like you have an AnimationTree active. It will override the AnimationPlayer and will force the animation values so you won't be able to edit it. You'll need to deactivate the AnimationTree to be able to modify the animations.

mrcdk avatar Feb 27 '23 08:02 mrcdk

Thanks, i didn´t realize i had it enable

TadeoOrtiz avatar Feb 27 '23 16:02 TadeoOrtiz

This seems a bit confusing, so maybe something can be improved here.

KoBeWi avatar Feb 27 '23 23:02 KoBeWi

Ran into a similar issue myself.

I was using the rotation property of a Marker2D. With an AnimationTree active in the scene the rotation property becomes locked to a value of 0 after it has been key-ed to an animation.

However, if I change the track mode for the property from continuous to discrete then I am able to change the value of rotation and key it properly again.

Or, as @mrcdk said, if you deactivate the AnimationTree then you can still change the property value and key it even if the track mode is still continuous (which is the default when key-ing the property).

valegians avatar Mar 01 '23 17:03 valegians

I've run into a similar issue in Godot 4.0. The minimal reproduction project is attached.

I have an AnimationTree with an AnimationNodeStateMachine manually driving the animations for an AnimationPlayer. The AnimationPlayer has three animations: MoveRight, RotateToZero, and RESET. The MoveRight animation moves a sprite to the right, the RotateToZero sets the rotation degrees to zero. RESET only sets the position of the sprite to Vector2.ZERO.

The issue arises when the RotateToZero rotation track is set to continuous as valegians (above) stated.

The issue is that if I set the sprite rotation by code, then once AnimationTree.advance() is called, the sprite is rotated back to zero. This happens regardless of the angle set in the rotation track in the RotateToZero animation.

Another thing to note is that inside of the AnimationNodeStateMachine, the AnimationTree goes from start -> MoveRight -> end. The RotateToZero animation is not inside of the AnimationTree at all. AnimationBug.zip

LeftCircle avatar Mar 09 '23 15:03 LeftCircle

I've run into a similar issue in Godot 4.0. The minimal reproduction project is attached.

I have an AnimationTree with an AnimationNodeStateMachine manually driving the animations for an AnimationPlayer. The AnimationPlayer has three animations: MoveRight, RotateToZero, and RESET. The MoveRight animation moves a sprite to the right, the RotateToZero sets the rotation degrees to zero. RESET only sets the position of the sprite to Vector2.ZERO.

The issue arises when the RotateToZero rotation track is set to continuous as valegians (above) stated.

The issue is that if I set the sprite rotation by code, then once AnimationTree.advance() is called, the sprite is rotated back to zero. This happens regardless of the angle set in the rotation track in the RotateToZero animation.

Another thing to note is that inside of the AnimationNodeStateMachine, the AnimationTree goes from start -> MoveRight -> end. The RotateToZero animation is not inside of the AnimationTree at all. AnimationBug.zip

Currently experiencing a similar issue. I have some code that will rotate a node, and when an animation exists (which is not in use) that alters the same property, it will force the rotation value to lock in place.

RobTheFiveNine avatar Dec 27 '23 15:12 RobTheFiveNine