Jump to content
Aveyond Studios Community
Sign in to follow this  

Call Method in Script Component

Recommended Posts



Use a method in a script.

A few important notes:

  • If the script is not attached to the game object, you need to do this first, using the Attach Script Component action. If the script is not attached, nothing will happen.
  • The method must be public. 
  • Parameters must not use the ref or out keywords.
  • If the method has a parameter type that is not supported by HeroKit, the action will be skipped. If you absolutely need this parameter type, you can modify HeroKit to include it (you will need to code c#).
  • This action uses Reflection, which is not performant. If you need to use the method in an event which loops, create a custom action for it.


Use the method on a different object - If you want to use this action on another hero object, mark this box and select the hero object (hero object field A).

The script on the hero object - Put the script you want to work with in this field (unity object field A). Information about the script populates the next fields.

The method to call in the script - Select the method that you want to call in the script. Only public methods are shown.

Parameters to pass into this method - (If the method has parameters, they are listed here) A list of parameters that you want to pass into the method. You can only work with parameters that can be linked to variables in a hero object or hero property.

There are no parameters for this method - This appears if the method has no parameters to pass into it.

Return value to save on the hero object - (If the method has a return value, it is listed here) The value that is returned by the method. You can only work with parameters that can be linked to variables in a hero object or hero property.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...