Can't change position

Godot Version

Godot 4.2.1 Stable


After using this script:

extends Sprite2D

func _on_m_bottom_1_mouse_entered():
	$PinkCard.position = $"Me/mBottom 1".position

nothing happens when my mouse enters the area why is this happening , but when i add print to the code instead of changing position it works why is this ?

What is Me node and what is mBottom 1? If the Me node is a container then it will not work as it is not possible to edit position/size of a child inside a container

You could try global_position instead of position, if $Me has an offset it will work differently.

Seems like i’ve been changing position to the Area2D but when i changed the position to the collisionshape2d it worked because i didnt change the position of area 2d so it stayed at 0,0
Thanks for the help

1 Like