Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit44fd9e59bd

README.md

entityOps.removeComponents

Detach component(s) from one or many entities — the counterpart to entityOps.addComponents.

entityOps.removeComponents("lamp", "Light")
entityOps.removeComponents({ "crate_1", "crate_2" }, { "Physics", "Audio" })
entityOps.removeComponents({ component = { "Light" } }, "Light")
entityOps.removeComponents("lamp", "light")       -- partial name, resolved

Targets take a name or id, a list of them, scene.find records, or a query resolved for you — so a component is stripped from everything carrying it without naming a single entity.

Component names match loosely: the leaf ("Light"), the full identity ("@builtin::components.Light"), a VFS path, or a case-insensitive partial. The response reports the canonical name it resolved to, so a half-remembered name both works and teaches you the real one.

A name that could mean several components is an error listing the candidates rather than a guess, and a name matching nothing is an error too — nothing is silently skipped.

Every entity comes back as { id, name, removed, absent }:

  • removed — components it carried and lost.
  • absent — components it never had, so nothing happened for them.

That split makes a call which changed nothing visible, instead of letting it read like a success.