question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

can we have Object3D.remove() with no arguments remove an object itself?

See original GitHub issue

so that we can write light.remove(); instead of light.parent.remove(light); ?

right now .remove() does not seem to be doing anything so there will be no conflict.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:20 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
donmccurdycommented, May 7, 2021

The purpose of the method is to {disconnect, detach, unlink, unparent, remove} an object from the scene graph, without changing or destroying the object itself. Names like destroy() sound more like our current dispose() method, permanently de-allocating the object’s resources.

Blender calls this operation Clear Parent. jQuery calls it .detach().

1reaction
mrdoobcommented, May 12, 2021

object.removeFromParent() sounds like the best option to me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Object3D#remove – three.js docs
Constructor. Object3D(). The constructor takes no arguments. Properties. # .animations : AnimationClip. Array with object's animation clips.
Read more >
ThreeJS: Remove object from scene - javascript - Stack Overflow
The problem is, entity is not removed from screen once loaded when Hide button is clicked. What can I do to make Hide...
Read more >
How to remove the child of an Object3D in three.js - Educative.io
We can use two methods to remove the child of an Object3D class object which is present inside the three.js scene graph: The...
Read more >
Entity - A-Frame
When we pause an entity, it will stop its animations and call Component.pause() on each of its components. The components decide to implement...
Read more >
Set.prototype.delete() - JavaScript - MDN Web Docs - Mozilla
Because objects are compared by reference, you have to delete them by checking individual properties if you don't have a reference to the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found