
simIsHandleValid / sim.isHandleValid
Description
|
Checks whether a general object handle is still valid. When a general object is destroyed (e.g. programmatically or via the user interface), then its related handle is not valid anymore and will trigger an error when used. Use this function to avoid triggering an error. See also sim.getObjectHandle, sim.getCollectionHandle, sim.getCollisionHandle, sim.getDistanceHandle, sim.getIkGroupHandle, sim.getScriptHandle and sim.getObjectUniqueIdentifier. |
C synopsis
|
simInt simIsHandleValid(simInt generalObjectHandle,simInt generalObjectType)
|
C parameters |
generalOjectHandle: handle of a general-type object (e.g. scene object, collision object, distance object, etc.)
generalOjectType: type of the general object. Refer to the general object types. Can be -1, in which case the specified handle is checked for validity in all types (handles of different types never overlap)
|
C return value
|
-1 if operation was not successful, 0 if the handle is not valid anymore, or 1 if the handle is still valid.
|
Lua synopsis
|
number result=sim.isHandleValid(number generalObjectHandle,number generalObjectType=-1)
|
Lua parameters |
Same as C-function
|
Lua return values
|
Same as C-function
|
All regular API functions on one page
|