I have
this.data.forEach((pos, i) => {
const entity = new pc.Entity(`trigger${++i}`);
entity.addComponent("collision");
entity.collision.halfExtents = new pc.Vec3(3, 0.5, 3);
entity.addComponent("script");
...
});
but how can I add to entity existing trigger.js script in code?
this is alternative to selecting script in editor
question about not engine only