end camera preview
This commit is contained in:
parent
22ff2601e5
commit
8463e7cc23
10 changed files with 139 additions and 26 deletions
24
entities/startCounter/start_counter.gd
Normal file
24
entities/startCounter/start_counter.gd
Normal file
|
@ -0,0 +1,24 @@
|
|||
extends Control
|
||||
class_name StartCounter
|
||||
|
||||
@onready var label: Label = $Label
|
||||
@export var car: Car
|
||||
@export var timeManager : TimeManager
|
||||
|
||||
var count_down_started := false
|
||||
var count_down := 3.0
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
if !count_down_started: return
|
||||
if count_down < 0:
|
||||
car.freeze = false # Activating car
|
||||
timeManager.process_mode = Node.PROCESS_MODE_INHERIT
|
||||
queue_free() # Delete counter
|
||||
count_down -= delta
|
||||
label.text = str(int(count_down))
|
||||
|
||||
|
||||
|
||||
func _on_camera_3d_preview_ended() -> void:
|
||||
show()
|
||||
count_down_started = true
|
Loading…
Add table
Add a link
Reference in a new issue