Regular API function

simAssociateScriptWithObject / sim.associateScriptWithObject

Description Sets the associated object of a child script. Use with care when simulation is running. See also sim.getObjectAssociatedWithScript, sim.addScript and sim.setScriptText.
C synopsis simInt simAssociateScriptWithObject(simInt scriptHandle,simInt objectHandle)
C parameters
scriptHandle: handle of the child script
objectHandle: handle of the associated object, or -1 to remove the association
C return value
-1 if operation was not successful
Lua synopsis sim.associateScriptWithObject(number scriptHandle,number objectHandle)
Lua parameters
Similar to the C-function counterpart
Lua return values

All regular API functions on one page