Trouble with cloning in code

The object is not cloning, this is my code.

var OtherInteractions = pc.createScript(‘otherInteractions’);
OtherInteractions.attributes.add(‘cubentity’,{type: ‘entity’});

OtherInteractions.prototype.initialize = function() {

};

OtherInteractions.prototype.update = function(dt) {
this.entity.clone(this.cubentity);
};

The object is a rigidbody so I do not see why it is not cloning. I am stressed out, i can’t find out how to make an object do something when it hits a specific rigidbody, and I don’t know what to do here. I need help. I have to find out something new to make my game.

@jus.co_ding_me_23 you almost got it you just needed this.app.root.addChild(entity);


var OtherInteractions = pc.createScript(‘otherInteractions’);
OtherInteractions.attributes.add(‘cubentity’,{type: ‘entity’});

OtherInteractions.prototype.initialize = function() {
 var entity = this.entity.clone(this.cubentity);
 this.app.root.addChild(entity);
};

OtherInteractions.prototype.update = function(dt) {

};


thanks a lot, that helped

but i tried still same thing, nothing works

works now, i put a cache