et on rajoute un animation node blend tree

et ouai! on est comme ça par ici.
on a suivi un tuto
alors on fait les beaux

https://www.youtube.com/watch?v=iElHZhOxGYA
This commit is contained in:
Thomas
2025-02-21 18:45:04 +01:00
parent bf4bfb9f5a
commit 134759b1b5
2 changed files with 20 additions and 9 deletions

View File

@@ -7,7 +7,7 @@ extends CharacterBody2D
@export var wants_to_grab = false;
@onready var animation_tree := $AnimationTree
@onready var state_machine := animation_tree.get("parameters/playback") as AnimationNodeStateMachinePlayback
@onready var state_machine := animation_tree.get("parameters/HumanState/playback") as AnimationNodeStateMachinePlayback
var last_facing_direction = Vector2(0,-1) # facing south
@@ -19,9 +19,9 @@ func readInputs():
velocity = Input.get_vector("move_left", "move_right", "move_up", "move_down") * speed
func updateFacingDirectionInAnimationTree():
animation_tree.set("parameters/walking/blend_position", last_facing_direction)
animation_tree.set("parameters/idling/blend_position", last_facing_direction)
animation_tree.set("parameters/grabing/blend_position", last_facing_direction)
animation_tree.set("parameters/HumanState/grabing/blend_position", last_facing_direction)
animation_tree.set("parameters/HumanState/idling/blend_position", last_facing_direction)
animation_tree.set("parameters/HumanState/walking/blend_position", last_facing_direction)
func _physics_process(delta):
readInputs()