I’m following the Magic Ink tutorial on the Defold website. However, I’ve made it to the point where the magic effects are spawned and parented to the block object, and I’ve run into a problem. Checking the effect’s parent immediately after parenting them gives a nil value, which means the following code also doesn’t work as intended.
Messages aren’t processed until the end of the current frame so getting the parent won’t work immediately (see the update loop manual). It shouldn’t be causing problems with the rest of the code - what’s the exact issue you’re running into?
It turns out that the go.set_parent() method has keep_world_transform default to false.
But the set_parent message has keep_world_transform default to true
So in your case, because you are using the message and not the method, you are are instructing it to keep the same world position after it gets assigned to the new parent.