Skip to main content

GameObject.SendMessageUpwards(string methodName, any value = nil)

Calls the method named methodName on every MonoBehaviour in this game object and on every ancestor of the behaviour.

Parameters:

NameTypeDescription
methodNamestringThe name of the method to call.
valueanyAn optional parameter value to pass to the called method.

Usage

---@type GameObject
local gameobject;

---@type string
local methodName;

---@type any
local value;


gameobject.SendMessageUpwards(methodName, value)