Hallo,
I've tried the BlendSpace2d node.
It doesn't seem to loop the animation. I've an idle animation, a walk animation and a run animation.
Well, if i run the animation from the Animation player they loop fine.
If i use them from code no loop at all.
I was following a tutorial on youtube.
Here's my code. No errors. Loop enabled for every animations.
Any idea? Thanks a lot.
extends Spatial
const locomotion_type ={
'idle' : Vector2(0,0),
'run' : Vector2(0,2),
'walk' : Vector2(1,0)
}
onready var animator = $AnimationPlayer/AnimationTree
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
var target = null
if Input.is_action_pressed("walk"):
target = locomotion_type.walk
if Input.is_action_pressed("run"):
target = locomotion_type.run
else:
target = locomotion_type.idle
animator['parameters/locomotion/blend_position'] = target