Wiki

Case Status
Log In

Wiki

 
Home ยป Action Reference»ScriptControl Actions»Call Method
Index
Navigation
Community Wiki

Call Method

Lets you call a method in a script on a Game Object.

Unlike Invoke Method, or Send Message, you can use multiple parameters and get a return value.

Behaviour
The behaviour on a GameObject that has the method you want to call. Drag the script component from the Unity inspector into this slot. HINT: Use Lock if the script is on another GameObject.

NOTE: Unity Object fields show the GameObject name, so for clarity we show the Behaviour name as well below.
Method
Select from a list of available methods.

NOTE: The full method signature is visible below.
Parameters
Method parameters.

NOTE: This UI is built automatically when you select the method.
Store Result
If the Method has a return, use this to store it in a variable.
Every Frame
Repeat every frame.
Manual UI
Revert to the old Manual UI where all parameters had to be configured manually.

 

Example Usage:

Note how we drag the component itself into the Behaviour slot.

Known Issues

After you drag a component into the Behaviour slot, the slot is now of that type, and will only accept behaviors of that type. To change the type select None first or Reset the action in the Action Settings Menu. We're investigating a smoother solution...

 

NOTES

  • Sometimes new Unity versions change method names. We do not currently detect this so you will need to update actions manually if method names change.
  • The online Unity API Versioner is a useful tool to explore method and property names across Unity versions.
Tags:

Last modified on 1/28/2019 6:06 PM by User.

  • RSS Feed