reactivate animation

This commit is contained in:
AleaJactaEst 2023-11-20 23:18:02 +01:00
parent 367eea75aa
commit 6b07896f39
9 changed files with 130 additions and 7240 deletions

View file

@ -2,6 +2,7 @@ extends AnimationTree
class_name AnimBlend
@export var movement_script : CharacterMovementComponent
func _physics_process(_delta):
if !movement_script:
return
@ -14,12 +15,9 @@ func _physics_process(_delta):
set("parameters/InAir/blend_amount" , 0.0)
#set("parameters/TimeSeek/seek_request", 0.0)
#set("parameters/Transition/transition_request","Idle")
#print("Idle")
Global.MOVEMENT_STATE.in_air: # Air
pass
set("parameters/InAir/blend_amount" , 1.0)
#set("parameters/InAir/transition_request","Failling")
#print("Falling")
Global.MOVEMENT_STATE.mantling: # couverture
pass
Global.MOVEMENT_STATE.ragdoll:

View file

@ -126,7 +126,6 @@ func reset_camera_transition(smooth_transition: bool = true):
tween.tween_property(Camera,"position",Vector3(0,0,SpringArm.spring_length),1.0)
tween.tween_property(Camera,"rotation",Vector3.ZERO,1.0)
tween.tween_callback(func(): reseting=false)
else:
Camera.rotation = Vector3.ZERO
Camera.top_level = false

View file

@ -324,7 +324,7 @@ func _physics_process(delta):
aim_rate_h = abs((camera_root.HObject.rotation.y - previous_aim_rate_h) / delta)
previous_aim_rate_h = camera_root.HObject.rotation.y
#
# animation_stride_warping()
#animation_stride_warping()
match movement_state:
Global.MOVEMENT_STATE.none:

View file

@ -1,8 +1,8 @@
extends Node
#------------------ Player Enums ------------------#
# Demarche (Attendre, Marcher, Courir, Pic de vitesse
enum GAIT {waiting, walking , running , sprinting}
# Demarche (Marcher, Courir, Pic de vitesse
enum GAIT {walking , running , sprinting}
# Sol, Air, Couverture, poupee de chiffon
enum MOVEMENT_STATE {none , grounded , in_air , mantling, ragdoll}
#

View file

@ -3,7 +3,7 @@ class_name PlayerGameplayComponent
@export_group("Stamina System", "stamina_")
@export var stamina_use: bool = false
@export var stamina_energy_consumption: float = 15.0#per second
@export var stamina_energy_consumption: float = 15.0 #per second
@export var stamina_attribute: GameAttribute
@export var networking : PlayerNetworkingComponent

View file

@ -36,7 +36,7 @@ func _ready():
pass
func set_id(value:int):
func set_id(value:int) -> void:
id = value

View file

@ -27,17 +27,28 @@ func set_otherplayer(value:bool):
func _ready():
$SpringArm3D/Camera3D.set_current(false)
$PlayerGameplayComponent.update_animations()
#$PlayerGameplayComponent.update_animations()
func set_current_camera():
func set_current_camera() -> void:
$SpringArm3D/Camera3D.set_current(true)
func set_id(value:int):
func set_id(value:int) -> void:
$PlayerNetworkingComponent.set_id(value)
func set_activate() -> void:
#$AnimationTree.set_active(true)
#$AnimationTree.set("parameters/Transition/transition_request","Idle")
pass
#func set_animation_tree_blend_positions(input_vector: Vector2) -> void:
# #print("Blend Position: ", input_vector)
# $AnimationTree.set("parameters/Idle/blend_position", input_vector)
# $AnimationTree.set("parameters/Walk/blend_position", input_vector)
func get_animation() -> String:
return $AnimationTree.get("parameters/Transition/current_state") + \
", " + str($AnimationTree.get("parameters/InAir/blend_amount")) + \
@ -51,16 +62,16 @@ func get_animation() -> String:
func get_gait() -> String:
return Global.GAIT.keys()[$PlayerGameplayComponent.gait]
return Global.GAIT.keys()[$CharacterMovementComponent.gait]
func get_stance() -> String:
return Global.STANCE.keys()[$PlayerGameplayComponent.stance]
return Global.STANCE.keys()[$CharacterMovementComponent.stance]
func get_rotation_mode() -> String:
return Global.ROTATION_MODE.keys()[$PlayerGameplayComponent.rotation_mode]
return Global.ROTATION_MODE.keys()[$CharacterMovementComponent.rotation_mode]
func get_movement_state() -> String:
return Global.MOVEMENT_STATE.keys()[$PlayerGameplayComponent.movement_state]
return Global.MOVEMENT_STATE.keys()[$CharacterMovementComponent.movement_state]

File diff suppressed because one or more lines are too long

View file

@ -74,6 +74,7 @@ func _on_connexion_updated(new_state:Multi.Connexion):
$PlayerSpawnLocation.get_child(0).set_current_camera()
$PlayerSpawnLocation.get_child(0).set_name(str(Multi.get_id()))
$PlayerSpawnLocation.get_child(0).set_id(Multi.get_id())
$PlayerSpawnLocation.get_child(0).set_activate()
$PlayerSpawnLocation.set_visible(true)
$CameraStarting.set_current(false)
else: