Skip to main content

VideoPlayer.BroadcastMessage(string methodName, any parameter = nil)

Calls the method named methodName on every Lua Script in this game object or any of its children.

Parameters:

NameTypeDescription
methodNamestringName of the method to call.
parameteranyOptional parameter to pass to the method (can be any value).

Usage

---@type VideoPlayer
local videoplayer;

---@type string
local methodName;

---@type any
local parameter;


videoplayer.BroadcastMessage(methodName, parameter)

Example

The Method needs to be attached to the Script object, similar to Start or Update functions.

do
local script = LUA.script;
function script.DoSomething()

end

end

Call DoSomething function:

do
local script = LUA.script;
local component = SerializedField("Component", TYPE.OBJECT);

function script.Start()
component.BroadcastMessage("DoSomething");
end
end