Hello! I need help identifying the cause for the discrepancy between these two pictures. On the left is how my weapons spawn in-game, and on the right is the spawn positions in the editor. I have the weapons roughly where I want them through trial and error, but I'd still like to learn what exactly is going on here.
Here is the relevant code.
`extends CharacterBody2D
var weapons = 0
#Dorbs
var basic_dorb = preload("res://Player/Weapon/basic_dorb.tscn")
var shotgun_dorb = preload("res://Player/Weapon/shotgun_dorb.tscn")
var rifle_dorb = preload("res://Player/Weapon/rifle_dorb.tscn")
#Dorb spawn points
@onready var dorb1 = get_node("%Orb1")
@onready var dorb2 = get_node("%Orb2")
@onready var dorb3 = get_node("%Orb3")
@onready var dorb4 = get_node("%Orb4")
func add_dorb(dorb):
if weapons < 4:
var new_dorb = dorb.instantiate()
dorb_equipped.append(new_dorb)
match weapons:
0:
new_dorb.global_position = dorb1.position
dorb1.add_child(new_dorb)
1:
new_dorb.global_position = dorb2.position
dorb2.add_child(new_dorb)
2:
new_dorb.global_position = dorb3.position
dorb3.add_child(new_dorb)
3:
new_dorb.global_position = dorb4.position
dorb4.add_child(new_dorb)
weapons += 1
else:
pass`