Files
Aula-Godot-3D/test/assets/addons/gdquest_bee_bot/bee_bot_skin.gd
T
2026-05-24 17:10:09 -03:00

32 lines
998 B
GDScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
extends Node3D
@onready var _animation_tree: AnimationTree = $AnimationTree
@onready var _main_state_machine: AnimationNodeStateMachinePlayback = _animation_tree.get("parameters/StateMachine/playback")
@onready var _secondary_action_timer: Timer = $SecondaryActionTimer
func _on_secondary_action_timer_timeout() -> void:
if _main_state_machine.get_current_node() != "Idle":
return
_main_state_machine.travel("HeadMovement")
_secondary_action_timer.start(randf_range(3.0, 8.0))
## Sets the model to a neutral, action-free state.
func idle() -> void:
_main_state_machine.travel("Idle")
_secondary_action_timer.start()
## Plays a one-shot attack animation.
## This animation does not play in parallel with other states.
func attack() -> void:
_main_state_machine.travel("Attack")
## Plays a one-shot power-off animation.
## This animation does not play in parallel with other states.
func power_off() -> void:
_main_state_machine.travel("PowerOff")
_secondary_action_timer.stop()