0 votes

Typically when you move a parent it's children move along with it. I want to be able to move a child and have its parents move (up to a point, don't want to move root or the viewport). Is there a way to do this? Should I switch the child/parent role and then switch back, does that cause any weirdness/data loss?

asked Sep 19, 2017 in Engine by jarlowrey (611 points)

1 Answer

0 votes
Best answer

This works perfect! Avoids all messy/dumb reparenting stuff and works no matter how many parenting layers are between parent and child

var diff = get_global_pos() - my_child.get_global_pos()
set_global_pos(other_node.get_global_pos() + diff)
answered Sep 19, 2017 by jarlowrey (611 points)
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.