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 (157 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,223 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 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 webmaster@godotengine.org with your username.