I've figured out how to get a list of files and create Meshinstances and have them appear properly in a scene but I also need to create Colliders for them which I can't quite seem to figure out. Although no errors are reported any collisionshapes I create turn out to be null. Here's where I've gotten to
for arm in armors:
var file = _path + arm + ".obj"
var arraymesh = load(file)
var mesh = MeshInstance.new()
mesh.mesh = arraymesh
add_child(mesh)
var coll = CollisionShape.new()
coll.shape = arraymesh
coll.name = arm
print(coll.shape)
I've tried setting the shape to arraymesh, mesh, and mesh.mesh but coll.shape still remains null and no collisions occur in the scene so although I've created colliders they are empty. Anyone know how to create the shapes properly (or am I barking up the wrong tree entirely?).
P.S. Yes, the meshes are valid and I can see them in the scene when I run it.