2020-02-01 18:07:20 +01:00

26 lines
656 B
GDScript

extends PushingBodyPart
onready var anim = get_node("Mesh/AnimationPlayer")
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
func action():
anim.play("ArmatureAction")
func push(body):
# We multiply by 0.1 because we only want it to spin slightly, it should mostly go up
var offset = transform.basis.xform(Vector3.ZERO)
var direction = (base.transform.basis.y - base.transform.basis.z).normalized() * 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