23 lines
488 B
GDScript
23 lines
488 B
GDScript
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)
|
|
var direction = (-base.transform.basis.z).normalized() * 15.0
|
|
|
|
base.apply_impulse(offset, direction)
|
|
|
|
timer.start()
|