I have the following entity that has the 'removedynamic' component:
AFRAME.registerComponent('removedynamic', { init: function() { var el = this.el; el.addEventListener('collide', function collision (event) { var collidedEntity = event.detail.body.el; if (collidedEntity.id == '#fruit'){ el.removeAttribute('dynamic-body'); el.removeEventListener('collide', collision); } }); } });
`
Version of physics system:
`
Whenever I try to remove the dynamic-body component i get the error TypeError: _bi2 is undefined and the app crashes(white screen). Sometimes the app doesn't crash but the error still appears and i believe(from testing) it's based on what type of body the entity collides with first (static or dynamic).
Is this supposed to happen? If yes, is there a workaround to this?
I have the following entity that has the 'removedynamic' component:
AFRAME.registerComponent('removedynamic', { init: function() { var el = this.el; el.addEventListener('collide', function collision (event) { var collidedEntity = event.detail.body.el; if (collidedEntity.id == '#fruit'){ el.removeAttribute('dynamic-body'); el.removeEventListener('collide', collision); } }); } });
`Version of physics system:
` Whenever I try to remove the dynamic-body component i get the error TypeError: _bi2 is undefined and the app crashes(white screen). Sometimes the app doesn't crash but the error still appears and i believe(from testing) it's based on what type of body the entity collides with first (static or dynamic). Is this supposed to happen? If yes, is there a workaround to this?