Added hitstop manager

This commit is contained in:
2026-06-27 23:10:54 +03:00
parent fef98da4e0
commit f8fbc206e8
8 changed files with 50 additions and 8 deletions
+15
View File
@@ -0,0 +1,15 @@
class_name CHitstopManager
extends Node
const NORMAL_TIME_SCALE = 1.0
@export var hitstop_duration := 0.1
@export var hitstop_time_scale := 0.0
func hitstop() -> void:
Engine.time_scale = hitstop_time_scale
await get_tree().create_timer(hitstop_duration, true, true, true).timeout
Engine.time_scale = NORMAL_TIME_SCALE
+1
View File
@@ -0,0 +1 @@
uid://ca6ix4nt5uxp3
+6
View File
@@ -0,0 +1,6 @@
[gd_scene format=3 uid="uid://ba262w3ebkyo1"]
[ext_resource type="Script" uid="uid://ca6ix4nt5uxp3" path="res://game/managers/hitstop_manager.gd" id="1_n7h4l"]
[node name="HitstopManager" type="Node" unique_id=669581391]
script = ExtResource("1_n7h4l")