Anim fix?
All checks were successful
All checks were successful
This commit is contained in:
parent
bf1ac4406c
commit
d39d719c7d
@ -33,6 +33,7 @@ var _light_was_on := false
|
||||
var _jump_triggered := false
|
||||
@onready var _flashlight: SpotLight3D = $SpotLight3D
|
||||
@onready var _anim_player: AnimationPlayer = find_child("AnimationPlayer", true, false) as AnimationPlayer
|
||||
@onready var _anim_tree: AnimationTree = find_child("AnimationTree", true, false) as AnimationTree
|
||||
@onready var _model_root: Node3D = find_child("TestCharAnimated", true, false) as Node3D
|
||||
|
||||
@export var camera_follow_speed := 10.0
|
||||
@ -54,6 +55,8 @@ var phone_visible := false
|
||||
|
||||
func _ready() -> void:
|
||||
add_to_group("player")
|
||||
if _anim_tree:
|
||||
_anim_tree.active = false
|
||||
axis_lock_angular_x = true
|
||||
axis_lock_angular_z = true
|
||||
angular_damp = 6.0
|
||||
@ -200,8 +203,8 @@ func _update_animation(on_floor: bool, velocity: Vector3) -> void:
|
||||
_anim_player.play(anim_jump_name)
|
||||
return
|
||||
if on_floor and horizontal_speed > anim_sprint_speed_threshold and _anim_player.has_animation(anim_run_name):
|
||||
if _anim_player.current_animation != anim_walk_name:
|
||||
_anim_player.play(anim_walk_name)
|
||||
if _anim_player.current_animation != anim_run_name:
|
||||
_anim_player.play(anim_run_name)
|
||||
return
|
||||
if horizontal_speed > anim_walk_speed_threshold and _anim_player.has_animation(anim_walk_name):
|
||||
if _anim_player.current_animation != anim_walk_name:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user