23 lines
488 B
GDScript3
Raw Normal View History

2020-02-02 16:03:44 +01:00
extends BodyPart
onready var anim = get_node("Mesh/AnimationPlayer")
onready var timer = get_node("Timer")
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
func action():
if timer.time_left == 0:
anim.play("ArmatureAction")
var offset = transform.basis.xform(Vector3.ZERO)
2020-02-02 16:27:09 +01:00
var direction = (-base.transform.basis.z).normalized() * 15.0
2020-02-02 16:03:44 +01:00
base.apply_impulse(offset, direction)
timer.start()