I'm working on a scene where I want a bunch of disk-looking things to fall from the ceiling and land flat in a stack on a platform.
As I've currently built it, each disk is an instance of a RigidBody2d node with a sprite and a CollisionShape2d that extends slightly beyond the sprite. They land on a StaticBody2d node that has a CollisionBody2d node.
When the disks land, they sort of mush and run over eachother (violating their CollisionBody2d shapes) and overlap and then vibrate as the others above them collide and then keep vibrating until they slowly work their way out of the stack and fall. I want them to simply land and sit. I can get one disk to land and sit happily.
Video here: https://www.youtube.com/watch?v=CwMsWie9Vbo
I've checked all my settings: bounce is at 0, gravity is at 1, etc. unless there's something I don't understand.
Although each instance appears to generate intelligently in a non-overlapping way, I was worried that they were overlapping somehow as they instanced in a way that messed with the collision expectation. So I instance them and change their location before the next instancing like so (this code runs in the video):
var disk_count = 7
var disk_scene = load("res://falling disk.tscn")
var n = 0
while (n < disk_count):
var new_disk = disk_scene.instance()
var instanced_disk = get_node("disk"+str(n))
var current_position = instanced_disk.get_pos()
var new_position = current_position + (Vector2(0,(-100*n)))
n = n+1
Is this a bug in the physics engine? Or am I missing some key part of the physics engine that would prevent this kind of behavior? Thank you!