This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

If I start with a Sprite, and then instance & add_child() another Sprite, it seems like the following is true:

If you create a tween, and move the parent by property "position" the child will automatically stay "locked" and move with the parent around on screen.

However, if you create a tween, and move the parent by property "offset" the child will stay in it's original position while the parent moves around on screen.

In my case, the child sprite is a highlighter around the parent sprite representing that the parent sprite is "active". My current solution is to run 2 tweens at the same time, one that moves the parent sprite's offset and one that moves the child sprite's offset in the same manner.

My question is: When you move the offset of a parent node, is it true that the child node does not automatically have it's offset changed to match that of the parents?

in Engine by (187 points)

1 Answer

0 votes
Best answer

No, the child is relative to the transform of the parent. No other settings such as the offset will affect the child nodes.

by (3,259 points)
selected by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.