khanat-client/scenes/creature_creation/creature.gd

35 lines
1.1 KiB
GDScript

extends Spatial
var direction = Vector3.ZERO
var rotation_speed_factor = 0.01
var orientation = 0.0
func _process2( delta ):
#var forwards: Vector3 = $look_at.global_transform.basis.z * direction.z
#var right: Vector3 = $look_at.global_transform.basis.x * direction.x
#if forwards:
# right = Vector3.ZERO
# var move_direction: = forwards + right
# if move_direction.length() > 1.0:
# move_direction = move_direction.normalized()
# move_direction.y = 0
#Config.msg_debug("delta:" + str(delta))
# Rotation.
# if (self.has_node( "creature" ) and $creature.can_turn()) or self.is_readying_weapon or self.is_weapon_ready:
# self.rotate_y( rotation_speed_factor * orientation )
# Animation.
#if self.has_node( "creature" ):
# Config.msg_debug("delta:" + str(delta))
for i in self.get_children():
# print("> " + i.get_name())
for ii in i.get_children():
# print(">> " + ii.get_name())
if ii.get_name() == "AnimationPlayer":
ii.play( "idle" )
# for iii in ii.get_children():
# print(">>> " + iii.get_name())
#$creature.AnimationPlayer.play( "idle" )
#$creature.play( "idle" )