Can't have more than one mesh in the scene (SOLVED)

I am currently drawing a single mesh per level (multiple times) just to give the impression of 3Dism to the game. I’d like to however, now that development is coming further along, introduce more 3D models into the game. However, when I create another mesh and assign it a unique buffer and place it in the scene my old 3D object using a separate buffer vanishes or shrinks to a super small size (likely a vec3(1,1,1) scale.) I’m wondering if I must use the model or if there’s some way to have multiple meshes in the scene. Also, if anyone knows if it’s possible to re-use the same buffer for multiple of the same object type by modifying the script, please let me know. Thanks again everyone for all the help, I’m hoping I can put out another gameplay video soon! Not sure how long this project will take, this is my first attempt at a complete game so I’m now hitting the thick of it. :stuck_out_tongue:

1 Like

If you are not modifying the meshes dynamically why not use models? I can’t give advice on this but it would be helpful like in many cases to post a minimal sample of it going wrong so it’s easier for others to take a look and see if there is a fix possible.

I’ll try to create an example. I am trying to modify the buffer dynamically (in order to create pillars of variable height in the map.) If I make any change to the buffer in a single instance it propogates to all the objects using that buffer. So I attempted to work around this by creating a new buffer/material and changing the values only for the new object but then the original object vanishes for some reason :stuck_out_tongue:

Yes, this is by design. Being able to have multiple objects sharing the same buffer is quite useful.

That should really work. If you can share a small example of the problem we can take a look and try to figure out what the problem is.

1 Like

Hmm, I checked today after restarting my PC and Defold and the issue has seemingly resolved itself. Not sure why. I’ll let you know if I figure out what’s causing it.