Godot Version
4.6.2
Question
my ui worked fine but then i realized i needed to make it reusable, so instead of making it in the level scene i made it it’s own scene and made it a child scene and re coded it but for some reason, the staticbody2d that controlled the ui completely broke, it worked fine but now it doesn’t work anymore after making the ui it’s own different scene
@onready var timelabel: Label = %timelabel
@onready var coollabel: Label = %coollabel
@onready var mouse_mode: Timer = $"mouse mode"
@onready var cooldown: Timer = $cooldown
@onready var canmouse: Sprite2D = %canmouse
var is_active = false
func _process(_delta: float) -> void:
Input.mouse_mode = Input.MOUSE_MODE_HIDDEN
#ui
timelabel.text = str(roundi(mouse_mode.time_left))
coollabel.text = str(roundi(cooldown.time_left))
if mouse_mode.time_left == 0:
canmouse.visible = true
else:
canmouse.visible = false