Skip to content

Lock

Updated

Editor-only flag that stops the entity from being selected or moved.

Type
comp-lock
Script class
LockComponent
Per entity
One
Version
1.0.0
Enable
Always on

Read about it in Common components: what it does, how to use it from a script, and examples.

Sent to the entity’s Signal Emitter as { entityId, eventType, data }. Compare eventType with the EventType constants.

  • Lock::change

Run it in the browser, read its scripts, and download it as an XR Creator project.

#pragma lifecycle(startup)
function startup() {
const component = self.parent.getComponent(LockComponent);
if (component) log(component.props);
}