Instanced Scene is sized differently in two different parent scenes.

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

I have an IceProjectile (rigidbody) scene that is loaded in the Player scene as the player is winding up. It is added as a child to a boneAttachment on the player.

When they release the ice, a signal is emitted and the Level scene picks up the signal and instances an IceProjectile to make it look as if the the player released the ice.

In both of these parent scenes, the IceProjectile appears as a different size, (very small when the player is loading, and normal size when released into the level) despite being instanced from the same scene. If I scale the IceProjectile scene used in both scenes, the corresponding sizes are both affected.

Does anyone have any idea what is going on here?

30sec video below to demonstrate and show code.

:bust_in_silhouette: Reply From: Lopy

Scale is inherited between Node2Ds, in other word, the scale property of a Node2D is expressed in terms of the global scale of it’s parent. For instance, if you have a parent Node2D with a scale of 2, the children will have a global scale of 2 when their local scale is the default 1. If we wanted the children to have a default global scale in this example, we would need to give them a local scale of .5 to compensate. Another option is to break the chain of scale inheritance (as well as position and rotation), using a regular Node ($ParentNode2D/GapNode/ChildNode2D).

To troubleshoot this kind of problem, you can use the “remote” view in the Editor: Launch you game, and then select the Editor without closing your game. On top of the scene tree view on the left, you should see “Remote” and “Local”. Click on “Remote” to see the Node tree of your running game. You can then click on Nodes to check their properties, and see what went wrong.