Regular API function

simRemoveObject / sim.removeObject

Description
Removes an object from the scene. See also sim.removeModel.
Object destruction always tries to destroy attached scripts before destroying the object itself. If a script tries to destroy the object it is attached to, then the object will first be destroyed, and the script destruction will be delayed.
C synopsis simInt simRemoveObject(simInt objectHandle)
C parameters
objectHandle: handle of the object to remove. sim_handle_all removes all objects from the scene
C return value
-1 if operation was not successful
Lua synopsis sim.removeObject(int objectHandle)
Lua parameters
Similar to the C-function counterpart
Lua return values
none
Remote API equiv.
B0-based remote API: simxRemoveObjects
Legacy remote API: simxRemoveObject