Samuel Girardin Posted October 20, 2014 Share Posted October 20, 2014 Hi Temechon, I think you developed the oimo plugin, maybe there is a mini bug here, not sure perhaps I m doing something wrong.. So it s here : public unregisterMesh(mesh: AbstractMesh): void { for (var index = 0; index < this._registeredMeshes.length; index++) { var registeredMesh = this._registeredMeshes[index]; if (registeredMesh.mesh === mesh || registeredMesh.mesh === mesh.parent) { if (registeredMesh.body) { this._world.removeRigidBody(registeredMesh.body.body); this._unbindBody(registeredMesh.body); } this._registeredMeshes.splice(index, 1); return; } } }I have to unregister several meshes (just boxes) and when I do it I have an error here : if (registeredMesh.mesh === mesh || registeredMesh.mesh === mesh.parent) {with registeredMesh.mesh === mesh.parent -> Uncaught TypeError: Cannot read property 'parent' of null With only registeredMesh.mesh === mesh unregister is ok. I m doing something wrong or that s a bug ? Sam Quote Link to comment Share on other sites More sharing options...
Temechon Posted October 20, 2014 Share Posted October 20, 2014 Hey there Samuel, i don't think it's a bug... Your error indicates that you are trying to unregister a 'null' object : Uncaught TypeError: Cannot read property 'parent' of null so 'mesh' is null.Can you please check if everything is ok from your side ? Thanks Cheers, Quote Link to comment Share on other sites More sharing options...
Samuel Girardin Posted October 20, 2014 Author Share Posted October 20, 2014 You're right... ! Maybe too tired yesterday night ! Thanks ! Quote Link to comment Share on other sites More sharing options...
Temechon Posted October 20, 2014 Share Posted October 20, 2014 No problem at all Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.