-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scaling issue with Rigidbody2D #89898
Comments
Hi, Absolutely fantastic high effort MRP. I believe you swapped the vertical and horizontal labels around, no big deal. The behavior is known, however, as the scale of a RigidBody is intended to be 1 in order not to mess up the physics calculations. Your scale actually gets applied, but is immediately modified by the RigidBody (which is the point of a RigidBody, to let it update the object's transform based on how it was affected by the physics system). Did you manually set the scale for the second row in the inspector? Those don't get scaled at runtime for me either when running your MRP, everything else is the same however. More info: #5734, #79929, https://stackoverflow.com/questions/77590667/godot-physics-resizing-my-sprites-at-runtime |
Modifying the scales and sizes of the children nodes is definitely the way to go. I think the ideal approach is something in between your two ideas: I'd put everything that needs to be affected inside a |
Oh right, I could put everything in a container but the CollisionShape then I'd only have to worry about 2 things, IDK how I did not realise that, I was so focused on making it all work in one go that I missed it. Thank you again for your thoughtful insights ! |
Tested versions
System information
Windows 10 and 11 - v4.2.1.stable.mono.official [b09f793] - forward+ and gl_compatibility - both vulkan and gles3 - NVIDIA GeForce RTX 4060 Laptop GPU / NVIDIA GeForce RTX 3060 GAMING OC 8G
Issue description
When trying to scale a Rigidbody2D, either nothing happens, or the X component of the scale gets used for both X and Y values.
Steps to reproduce
Add a Rigidbody2D to a scene, and in it's script, assign the
Scale
during theReady()
call.Minimal reproduction project (MRP)
BugTestScale.zip
The text was updated successfully, but these errors were encountered: