SetPrefabInstanceScriptStringVariable

Definition

SetPrefabInstanceScriptStringVariable(string prefabInstanceName, string variable, string value)

Description

This function sets the value of the String 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 String variable defined in the script attached to the prefab instance PrefabInstanceName.

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

Example

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

function Init()
    SetPrefabInstanceScriptStringVariable("1_VandaEngine17-SamplePack1_birdcage""a""hello")
end

function Update()

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