Skip to content

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.

objects.detach(id: number): Promise<ActionResult>
Name Type Description
id number The ID from objects.create.

An ActionResult. An already detached object returns applied. An unknown ID returns object-not-found.

gamemodes/my-mode.ts
import { objects } from "nativemp";
const objectId = 268435457;
await objects.detach(objectId);