24 lines
495 B
GDScript3
24 lines
495 B
GDScript3
|
extends Spatial
|
||
|
|
||
|
|
||
|
export(int) var key
|
||
|
|
||
|
onready var limb = get_node("Limb")
|
||
|
|
||
|
|
||
|
# Called when the node enters the scene tree for the first time.
|
||
|
func _ready() -> void:
|
||
|
pass # Replace with function body.
|
||
|
|
||
|
|
||
|
func _unhandled_input(event):
|
||
|
if event is InputEventKey:
|
||
|
if event.pressed and event.scancode == key:
|
||
|
if limb.get_child_count() > 0:
|
||
|
limb.get_child(0).action()
|
||
|
|
||
|
|
||
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||
|
#func _process(delta: float) -> void:
|
||
|
# pass
|