objects.detach
Stops following the target and leaves the object at its last shared position and rotation. Its regular collision resumes. A removed target or one that leaves the virtual world causes the same detachment.
Signature
Section titled “Signature”objects.detach(id: number): Promise<ActionResult>Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
id |
number |
The ID from objects.create. |
Returns
Section titled “Returns”An ActionResult. An already detached object returns applied. An unknown ID returns object-not-found.
Example
Section titled “Example”import { objects } from "nativemp";
const objectId = 268435457;await objects.detach(objectId);