SetPrefabInstanceScriptIntVariable

Definition

SetPrefabInstanceScriptIntVariable(string prefabInstanceName, string variable, int value)

Description

This function sets the value of the Integer variable defined in the script attached to the prefab instance PrefabInstanceName.

Parameters

PrefabInstanceName
Specifies the name of the prefab instance.

variable
Specifies the name of the Integer variable defined in the script attached to the prefab instance PrefabInstanceName.

value
Specifies the value of the Integer variable to be set.

Example

--script name is SetPrefabInstanceScriptIntVariable.lua attached a to game object such as water

function Init()
    SetPrefabInstanceScriptIntVariable("1_VandaEngine17-SamplePack1_birdcage""a", 1)
end

function Update()

end
Assuming that the variable “a” is defined in the script attached to the prefab instance “1_VandaEngine17-SamplePack1_birdcage”SetPrefabInstanceScriptIntVariable function sets the value of “a” to 1.
adminSetPrefabInstanceScriptIntVariable