[SOLVED] Array Variable Suddenly Disappear


I am not able to add array.

Here is the script. It was working few months ago…

var Rotate = pc.createScript('rotate');

Rotate.attributes.add('ballHolderCompEntity', {type: 'entity', array: 'true'});

// initialize code called once per entity
Rotate.prototype.initialize = function() {

// update code called every frame
Rotate.prototype.update = function(dt) {
    this.entity.rotateLocal(0, 3, 0);  

As you can see following image…

Even after clicking on Parse ballHolderCompEntity is not visible…
(Actually ballHolderCompEntity variable appears and suddenly disappears…)

Please help… Am i doing it right?
Is there any new way to do this? :roll_eyes:


After clicking on parse i see following thing in console…

Hi @Ketan_ATA! I tried this with your setup and then the variable does indeed disappear. If I change your attribute variables like the way below, it works correctly. So if a variable disappears I think there is something wrong with the setup of the variable, but the engine should handle this in a better way.

Rotate.attributes.add('ballHolderCompEntity', {type: 'entity', array: true});

Wow! @Albertos Thank you very much! :pray:t2:
It was silly mistake… My bad… true false never comes in quotes…

1 Like