Joint2D Scaling Issues

Godot Version

4.4

Question

I’ve got a 2D Skeleton Setup, and I’m scaling the root bone I added to make everything smaller when the player falls into a hole. It works fine. But I have added PinJoint2D’s in the eye-sockets to make the eyes bounce around. Again this work fine.

However, when I call the animation that scales the root bone down, it properly scales everything down besides what it attached to the PinJoint2D. (only in game)

Is this normal behavior?

I tested all three 2D joint sub-classes as well, and it seems the issue lies with the parent class Joint2D.

I’ve attached a video, ignore that the node is called GrooveJoint2D, I changed the type and tested all 3 setups.

VIDEO

Is the Joint2D supposed to preventing scaling at some level? I assumed it would only be operating in it’s physics process the change to the positions. Or perhaps I messed up something in my scene tree, but I can’t see anything apparent.

Manipulating the transform of a RigidBody2D at runtime like what you are doing by changing its scale will create some issues because the physics server will reset the transform to the physics state every physics frame. You could try enabling RigidBody2D.freeze before changing its scale.

2 Likes

I see why. That will have to work.

I ended up creating a tweener in the function to scale the eye sprites down simaltaneously alongside the animation.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.