SlimeoosOdyssey/godot/Models/slime.gd

15 lines
383 B
GDScript3
Raw Normal View History

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