Regular API function

simRemoveObject / sim.removeObject (remote API equivalent: simxRemoveObject)

Description
Removes an object from the scene. See also sim.removeModel.
Threaded child scripts can only destroy objects that do not contain other scripts attached than itself.
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. In a future release, a more differentiated return value might be available
Lua synopsis number result=sim.removeObject(number objectHandle)
Lua parameters
Same as C-function
Lua return values
Same as C-function

All regular API functions on one page