tags: factory title: Dynamic factories brief: This example shows how to change the prototype game object used by a factory component. author: Defold Foundation
This example shows how to change the prototype game object used by a factory component. All prototype bullets are stored in a collection and referenced as a collection proxy. The collection proxy is never loaded, but it will ensure that the bullet prototypes are included in the build even though they are not immediately used by a factory. Another alternative is to load bullet prototypes using Live Update.
ship : The red ship at the bottom. Contains:
All bullets are added in the bullets.collection:
The bullets.collection is referenced from the dynamic.collection as a collection proxy: