Using a Collection During a Playing Session

You can use your collection during a playing session.

For example, you can display the content of a collection (named CollectionTest in the following example).

See Also
About Collections
Create and Rename a Collection
Managing Objects in Collections
Editing Collections
  1. Create a script from the Behavior Editor.
    For more information, see Creating Scripts.
  2. Add your JavaScript code.
    beScript.onStart = function () {
                    var myCollection = this.getActor().getExperience().getCollectionByName("CollectionTest");
                    if(myCollection !== null && myCollection !== undefined){
                                    for(var i = 0; i < myCollection.getObjectCount(); i++){
                                                    console.log(myCollection.getObjectAt(i).getName() + " is in collection " + myCollection.getName());
                                    }
                    }
    };
    
    beScript.onStop = function () {
    };
    
    beScript.execute = function (context) {
    };