delete_instance

Permanently removes an instance and all its descendants.

What it does

delete_instance takes a single DataModel path and removes that instance from the game. Every descendant of the instance — child parts, scripts, folders, UI — is removed with it. The deletion is recorded in Roblox's ChangeHistoryService as part of the wrapping Revix waypoint, so pressing Ctrl+Z (Cmd+Z on Mac) restores the deleted tree.

Revix uses this tool when an instance is genuinely no longer needed, when cleaning up after a rewrite, or when starting fresh on a UI or part hierarchy. For renaming or moving instances rather than destroying them, see move_instance.

Parameters

NameTypeRequiredDescription
`path`stringyesDataModel path to the instance to delete.

When Revix uses it

  • Removing a script that has been replaced by a refactored module
  • Clearing a UI hierarchy before rebuilding it
  • Cleaning up scratch parts left from a previous experiment
  • Removing legacy RemoteEvents or folders that are no longer wired up

Example

text
delete_instance(path="Workspace/TestPart")
=> Deleted Workspace/TestPart

Troubleshooting

If something disappears that you wanted to keep, press Ctrl+Z (Cmd+Z on Mac) immediately — Studio's undo restores the full tree. See tool-undo for how Revix waypoints work.