Skip to content

Commit

Permalink
Merge pull request #93855 from ayanchavand/fix-docs-code-anim
Browse files Browse the repository at this point in the history
Fix AnimationMixer docs example code for `get_root_motion_rotation_accumulator`
  • Loading branch information
akien-mga committed Jul 2, 2024
2 parents 0955020 + a538436 commit 9db1a96
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/classes/AnimationMixer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,10 @@
func _process(delta):
if Input.is_action_just_pressed("animate"):
state_machine.travel("Animate")
var current_root_motion_rotation_accumulator: Quaternion = animation_tree.get_root_motion_Quaternion_accumulator()
var current_root_motion_rotation_accumulator: Quaternion = animation_tree.get_root_motion_rotation_accumulator()
var difference: Quaternion = prev_root_motion_rotation_accumulator.inverse() * current_root_motion_rotation_accumulator
prev_root_motion_rotation_accumulator = current_root_motion_rotation_accumulator
transform.basis *= difference
transform.basis *= Basis(difference)
[/gdscript]
[/codeblocks]
However, if the animation loops, an unintended discrete change may occur, so this is only useful for some simple use cases.
Expand Down

0 comments on commit 9db1a96

Please sign in to comment.