diff --git a/src/core/Object3D.js b/src/core/Object3D.js index 1c827e34..cae9880b 100644 --- a/src/core/Object3D.js +++ b/src/core/Object3D.js @@ -132,11 +132,11 @@ THREE.Object3D.prototype = { remove: function ( object ) { var scene = this; - var childIndex = this.children.indexOf( child ); + var childIndex = this.children.indexOf( object ); if ( childIndex !== - 1 ) { - child.parent = undefined; + object.parent = undefined; this.children.splice( childIndex, 1 ); // remove from scene @@ -149,7 +149,7 @@ THREE.Object3D.prototype = { if ( scene !== undefined && scene instanceof THREE.Scene ) { - scene.removeChildRecurse( child ); + scene.removeChildRecurse( object ); }