the “onTriggerEnter” Function is not working:
pc.script.create(‘brick’, function (app) {
// Creates a new Brick instance
var Brick = function (entity) {
this.entity = entity;
};
Brick.prototype = {
// Called once after all resources are loaded and before the first update
initialize: function () {
console.log('hi this is sensing as');
this.entity.collision.on('triggerenter', this.onTriggerEnter, this);
},
onTriggerEnter: function (entity) {
// Reset back to roughly the position the entity started in.
console.log('hi this is sensing');
var mover = app.root.findByName('Player');
mover.script.moving.reseter();
}
};
return Brick;
});