30 lines
696 B
GDScript3
Raw Normal View History

extends PushingBodyPart
onready var anim = get_node("Mesh/AnimationPlayer")
2020-02-02 12:14:27 +01:00
func _is_animation_playing():
return anim.is_playing()
func action():
anim.play("ArmatureAction")
2020-02-01 21:34:31 +01:00
# Apply a slight impulse here too
var offset = touch_area.global_transform.origin - base.global_transform.origin
var direction = base.transform.basis.y * 1.0
base.apply_impulse(offset, direction)
func push(body):
2020-02-01 21:34:31 +01:00
var offset = touch_area.global_transform.origin - base.global_transform.origin
2020-02-01 19:47:09 +01:00
var direction = -base.transform.basis.y * 5.0
base.apply_impulse(offset, direction)
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta: float) -> void:
# pass