Godot Version
godot-4.3 stable
Hello!
I would like to ask for a little help.
How can I make it so that when the code in the “else:” part is run, it returns to the basic position? I mean exactly:
“$AnimationTree.set(“parameters/Pindad_G2_Pistóly_Kezeles/blend_amount”, -1)”
After this has run, change it yourself to “$AnimationTree.set(“parameters/Pindad_G2_Pistóly_Kezeles/blend_amount”, 0)”.
The full code looks like this:
func _FEGYVER_KEZELES() → void:
if Input.is_action_just_pressed("Fegyver_1"):
if PINDAD_G2 != true and ZSEBLAMPA != true:
$AnimationTree.set("parameters/Pindad_G2_Pisztoly_Kezeles/blend_amount", 1)
$AnimationTree.set("parameters/TimeSeek 4/seek_request", 0)
PINDAD_G2 = true
else:
$AnimationTree.set("parameters/Pindad_G2_Pisztoly_Kezeles/blend_amount", -1)
$AnimationTree.set("parameters/TimeSeek 5/seek_request", 0)
PINDAD_G2 = false
Thank you in advance for your help.