Invalid get index 'global_points' (on base: 'Node3D').

Godot Version

godot 4


Invalid get index ‘global_points’ (on base: ‘Node3D’).

@onready var red = $red/ColorRect

var botik = load("res://character_body_3d.tscn")
var instance
@onready var spawns = $spawns
@onready var navigation_region = $NavigationRegion3D

func _ready():

func _on_мік_головний_player_hit():
	red.visible = true
	await get_tree().create_timer(0.2).timeout
	red.visible = false
func _get_random_child(parent_node):
	var random_id = randi() % parent_node.get_child_count()
	return parent_node.get_child(random_id)

func _on_spuwner_timeout():
	var spawn_point = _get_random_child(spawns).global_points
	instance = botik.instantiate()
	instance.position = spawn_point

That means that the object does not have a global_points property. Make sure that the child nodes of the $spawns node have an script attached that has the global_points property.