Work on pickups and multiplayer
This commit is contained in:
@@ -48,6 +48,21 @@ func _on_struggle_changed(value : float) -> void:
|
||||
else:
|
||||
struggle_bar.value = value
|
||||
|
||||
func set_animation_length(node_name : String, length : float) -> void:
|
||||
if length == 0:
|
||||
length = 0.01
|
||||
var blendtree : AnimationNodeBlendTree = anim_tree.tree_root.get_node(node_name)
|
||||
if !blendtree:
|
||||
return
|
||||
var anim_node : AnimationNodeAnimation = blendtree.get_node("Animation")
|
||||
if !anim_node:
|
||||
return
|
||||
var animation : Animation = anim_player.get_animation(anim_node.animation)
|
||||
if !animation:
|
||||
return
|
||||
var a_scale : float = animation.length / length
|
||||
anim_tree["parameters/%s/TimeScale/scale" % node_name] = a_scale
|
||||
|
||||
|
||||
func _on_footstep_timer_timeout() -> void:
|
||||
walk_sound.play()
|
||||
|
||||
Reference in New Issue
Block a user