I have a player with a rigidBody and collision component attached and another entity with just a collision component (a trigger box).
When the player enters the trigger box i want something to happen, however the onTriggerEnter does not seem to register.
On my player I have:
Player_interaction.prototype.initialize = function() {
this.entity.collision.on('triggerenter', this.onTriggerEnter, this);
}
Player_interaction.prototype.onTriggerEnter = function (result) {
console.log("TRIGGERED WITH "+result.other.name); //never fires
}
I’m expecting this to fire whenever my rigidbody player walks into ANY entity with a collision component but nothing happens. Whats wrong here?