0 votes

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.


Godot version v3.5 stable
in Engine by (12 points)

1 Answer

0 votes

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.

by (2,684 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 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.