I am building a component that watches (in tick
) the position of its entity, and when some condition is met, it removes the entity from the scene. How can I do the removing part?
For example:
AFRAME.registerComponent('remove-on-tick', {
tick: function () {
if (condition) {
// Remove entity.
}
}
});