I’m importing a gltf model, and using it as a blueprint for new starships in my game. I don’t need the imported model for anything else, so Ideally I would want to get rid of it.
Using (AssetContainer).meshes[0].instantiateHierarchy()
I can make new starships, though I can’t hide or dispose the imported mesh or the instances will have no vertices.
I can’t use (AssetContainer).instantiateModelsToScene()
(from this thread) as I need to get the bounding box info (using [mesh].getHierarchyBoundingVectors()
) and InstantiatedEntries
does not inherit from node
and does not have the function.
As I was just going over the docs, I noticed (InstantiatedEntries).rootNodes
. Could I use (AssetContainer).instantiateModelsToScene().rootNodes[0]
to get the new instance? If so this could save a lot of work, as I will not have any “base” mesh to instantiate from. Thanks!