This commit is contained in:
2025-01-18 12:10:54 +01:00
parent 14c0da55c3
commit 7c7d9d03f2
5 changed files with 48 additions and 7 deletions

View File

@@ -5,12 +5,15 @@ extends CharacterBody3D
@export var SENSI : float = 0.005
@export var SPEED_PARTICULES: float = 1;
@export var checkpoint:Node3D = null
@export var cooldown: float = 1
@export_group("Children")
@export var head: Node3D
@export var anim: AnimationPlayer
@export var particules: GPUParticles3D
@export var time_hand: float= 0
func _ready() -> void:
@@ -24,7 +27,7 @@ func _input(event: InputEvent) -> void:
head.rotation.x = clamp(head.rotation.x, -PI/2, PI/2)
func _physics_process(delta: float) -> void:
time_hand += delta
# Add the gravity.
if not is_on_floor():
if velocity.y < 0:
@@ -32,7 +35,8 @@ func _physics_process(delta: float) -> void:
else:
velocity += get_gravity() * delta * 3
if (Input.is_action_just_pressed("interact")):
if (Input.is_action_just_pressed("interact") and time_hand >= cooldown):
time_hand = 0
var vect
if(checkpoint == null):
vect = Vector3.DOWN * SPEED_PARTICULES