This commit is contained in:
aurinex
2025-08-07 17:58:10 +05:00
commit b7ccc4e3d3
24 changed files with 2006 additions and 0 deletions

29
scripts/3d_godot_robot.gd Normal file
View File

@ -0,0 +1,29 @@
extends Node3D
class_name Body
const LERP_VELOCITY: float = 0.15
@export_category("Objects")
@export var _character: CharacterBody3D = null
@export var animation_player: AnimationPlayer = null
func animate(_velocity: Vector3) -> void:
if not _character.is_on_floor():
if _velocity.y < 0:
animation_player.play("fall")
else:
animation_player.play("up")
return
if _velocity.length() > 0.1: # Если есть движение
if _character.is_running():
animation_player.play("run") # Спринт
else:
animation_player.play("walk") # Обычная ходьба
return
animation_player.play("idle") # Бездействие
@rpc("any_peer", "reliable")
func sync_player_rotation(rotation_y: float) -> void:
rotation.y = rotation_y