Godot v4.3 Stable – 77dcf97d8
Not a question, but noticed some interesting behavior with AnimationPlayer and wanted to know if this is intended…
// General Behavior with TSCN
Generally, there is a LEVEL TSCN and an OBJECT TSCN. The behavior is the interaction of the transformation properties regarding nested TSCNs.
When placing the object in the level, the transform information is independent of the the object transform information.
[Example]
Static3D is at location 0,0,0 within the object
Static3D is at location 6,6,6 within the level.
Running the game, the Static3D will be at location 6,6,6 in final render (0,0,0 object + 6,6,6 level).
Changing Static3D object to 1,1,1 and running game: the object will result in 7,7,7 final render (1,1,1 object + 6,6,6 world).
This is the expected and observed behavior.
// AnimationPlayer
If you take the same object tscn and add an AnimationPlayer, add a simple “slide” animation. It overrides the final render (or at least the world transform data).
Add AnimationPlayer
New Animation: Slide
Key0: Static3D/Transform/Position: 0,0,0
Key1: Static3D/Transform/Position: 0,7,0 (mimic a door sliding up)
Script: func action_door(): $AnimationPlayer.play(“slide”)
[Results]
The Static3D shows CORRECTLY in EDITING VIEWPORT when viewing the Level TSCN.
Rendering the Game: Object Snaps to 0,0,0 regardless of Level Transform Data.***
Note***: This only affects the values that are going to change within the AnimationPlayer Keys – in this instance, the _.position.y is the only value changing with the animation and thus X,Z are unaffected when the game starts running. When demo’ing this in levels, the doors would be “floating” in air or in the ground depending on the layouts.
// Workaround
I created a Node3D Master Node to parent all the objects to act as the world anchor and let the AnimationPlayer Manipulate the Static3D within the Anchor Object Space.
//
So either this is expected or I found a weird bug. :3