CharacterBody2D children not changing position with its parent

Godot Version

4.7.2

Question

I’m new to Godot and programming so apologies if this is easy, I just can’t seem to find the solution.

So I have a CharacterBody2D node as my player with three children; AnimatedSprite2D, RayCast2D, and CollisionShape2D. I want to teleport all three and a camera when I interact with a door. The script attached is connected to the Area2D node of the door (FYI player script doesn’t have anything related to position. Just animations, velocity, and input checks)

extends Area2D

var inside = false
@onready var camera: Camera2D = $"../room_change"
@onready var player: CharacterBody2D = $"../Player"

func _process(_delta: float) -> void:
	if Input.is_action_just_pressed("interact"):
		if inside == true:
			camera.global_position = Vector2(901.0, 300.0)
			player.global_position = Vector2(766.0,493.0)

func _on_body_entered(_body: Node2D) -> void:
	inside = true
	$arrow.visible = true

func _on_body_exited(_body: Node2D) -> void:
	inside = false
	$arrow.visible = false

The Camera2D and CharacterBody2D teleport exactly where I want them to however all of the CharacterBody2D node’s children get moved roughly around y500 from the position of the Character node.

I tested teleporting in a few bit other places and teleporting it anywhere within a few pixels of its starting position didn’t cause the children to move. Both position and global_position cause this.

Help would be appreciated.

Can you share your scene tree? Are any of your nodes set to “Top Level”? Are your player nodes centered at 0, 0 relative to the parent CharacterBody2D node?

Are you sure they are the children of the player scene?
Could you print(player.get_children()) and paste it here to show the children?

Have you set the way the children inherit their position to something other than the default, where they inherit position from the parent?

Oh I feel so stupid. Yes, my Character node was not centered with the rest of the children. I completely forgot it was at that position.

Sorry for the bother with such a simple and stupid mistake. Thank you for the help