my script isnt working because of the label. It is not working its just keeps on giving me a error: Invalid assignment of property or key ‘text’ with value of type ‘String’ on a base object of type ‘null instance’. I am trying to make it so when either player one or player 2 wins the game its shows who won on another scene. Code: `extends Node2D
@onready var player_1s_points: Label = $“Player 1s Points” @onready var player_2s_points: Label = $“Player 2s Points” @onready var title: Label = $Title
extends Node
var P1_Points = 0
var P2_Points = 0
var won_player: int = -1
In your win_screen.gd script:
extends Node2D
@onready var winner_sfx: AudioStreamPlayer = $WinnerSFX
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
winner_sfx.play()
Global.P1_Points = 0
Global.P2_Points = 0
$Title.text = "PLAYER %s
HAS WON!" % Global.won_player
Global.won_player = -1