SlimeoosOdyssey/godot/Models/slime.gd

15 lines
383 B
GDScript

extends Node3D
@onready var animation_state: AnimationNodeStateMachinePlayback = $AnimationTree.get("parameters/playback")
@export var colors: Array[Color]
func _ready():
var color = colors[randi() % colors.size()]
$Armature/Skeleton3D/Slime.get_active_material(3).albedo_color = color
func walk():
animation_state.travel("Walk")
func idle():
animation_state.travel("Idle")