Plz i need help

Godot Version

godot 4

extends Node
@onready var points_label: Label = %pointsLabel

var points = 0

func add_point():
points += 1
print(points)
points_label.text = "points: " + str(points);

extends Area2D

@onready var game_manegar: Node = %“game manegar”

func _on_body_entered(body: Node2D) → void:
if (body.name == “CharacterBody2D”):
queue_free()
game_manegar.add_point()

This code was working but after I added the enemies it stopped working

It means that the points_label is null, try to not use unique names, do it normally. Just hold CTRL and drag and drop that label in your codes to define it.

1 Like