How could I make a child node have the same position of the parent + an offset I can change?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Bilooty

In my project I have a player node who has a child which is an area2D
What I want to be able to do is change the area2D’s offset from the player at will in either the area2D script or the players. I’m a complete noob at Godot and I’m sure the answer is obvious. Thanks!’

:bust_in_silhouette: Reply From: kidscancode

A node’s position property is relative to its parent. If your Area2D’s position is set to (50, 50) and the player moves, it will remain that distance offset from the player.

So just change the position of your Area2D to achieve what you want.

How to dismiss this offset without affecting Area2D ?

sarthakroy | 2020-07-24 09:35