In my scene I'm trying to dynamically add a rigid body with a collision capsule to a spatial scene. I have a static body collision plane below, so it works normally if I add the nodes in the scene tree through the editor, but not with code.
My coded rigid body shows having a collision capsule, but falls right through the plane. I hope that I'm overlooking something.
The code I have looks like this:
var rb = RigidBody.new()
rb.translate(Vector3(0,10,0))
rb.set_mode(2)
var cs = CollisionShape.new()
cs.set_shape(CapsuleShape.new())
rb.add_child(TestCube.new())
rb.add_child(cs)
add_child(rb)