How to spawn correct, a collection with a Factory?

I tried to spawn a collection and I got some errors, help please to understand !!!

function init(self)
  local pos = vmath.vector3(100, 12.5, 0)
  local ids = factory.create("#factory", pos, nil, {}, nil) 	
end


ERROR:RESOURCE: Unknown resource type: collection
WARNING:RESOURCE: Unable to create resource: build/default/main/main_generated_0_generated_0.factoryc
WARNING:RESOURCE: Unable to create resource: build/default/main/main_generated_0.goc
ERROR:GAMEOBJECT: Could not instantiate game object from prototype /main/main_generated_0.goc.
WARNING:RESOURCE: Unable to create resource: build/default/main/main.collectionc

Did you add a factory or a collection factory as the component?

Yes, I did, as was shown in documentation

Add a collection factory instead, your screenshot shows a normal Game Object factory?

1 Like

Don`t understood…what I did wrong?


Compare with your factory - you have a normal factory, you need a collection factory instead.

collection factory → spawning Collections
factory → spawning Game Objects

1 Like