Godot Version
v4.4.stable.official [4c311cbee]
Question
Hi everyone! =D
I am having a bizarre problem with my RigidBodies. I want to build a small chat system where the new messages get typed out on top and then fall down to the bottom. I figured out how to do this and it works well in the scene I have built this system (it’s not fluid bc I made a GIF from the recording):
Once the message is written I resize the CollisionShape to the size of the MarginContainer and unfreeze the RigidBody → Then the message falls.
Right when this happens I also reparent the RigidBody to a Node2D in order to sort of archive the message and make room for the next one. The code looks as follows:
func archiving():
var shape = RectangleShape2D.new()
current_frame.position = current_coat.position + current_coat.size / 2
shape.size = current_coat.size
current_frame.set_shape(shape)
current_emotion.freeze = false
current_emotion.reparent($archive, true)
Now when I access this whole event from my RootScene the physics don’t work at all anymore (I highlighted the CollisionShapes from the StaticBody that should keep the messages in place):
As you can see it’s absolutely broken. I do know that something is up with the CollsionShapes of the RigidBodies because when I don’t resize them and keep them small it works!
Another issue that was happening was, that the Rigidbodies suddenly scaled to (2.8, 2.8) once they unfreezed in the latter example. I “fixed” this with telling the Rigidbodies to always keep being scaled to (1, 1) in the _physics_process.
I do move the RigidBodies position while they are frozen but once I unfreeze them I don’t manipulate them at all. So I think it does have something to do with resizing the CollisionShape. Does anyone maybe have a clue?
Thanks for reading!