So, I could get to nowhere with this method as _instances seems to be a private instance of HashTable object, thus I couldn’t access _instances so far from within the JS editor.
Is there a super simplistic way to do it, or should I go and extend the existing functionality?
I figured it out. For future reference, in case it will be useful for somebody, here is how it goes:
if (runtimeScene.getTimeManager().isFirstFrame()) {
getAllObjects(callback);
}
function getAllObjects(callback)
{
var result = [];
runtimeScene._instances.keys(result);
for (var i = 0, len = result.length; i < len; i++) {
const myObject = runtimeScene.getObjects(result[i]);
if (myObject.length !== 0) {
callback(myObject[0]);
}
}
}
function callback(var1)
{
var1.hide();
}
I have a similar problem like yours, but can we get the access instance of object without code?
I mean when when there are two instances of same object, say “Player” is object name and there are two “player” instances in the scene. In the events tab can i select them as → Player[0] and Player[1] , something like this…Is there a way??