I just got ORK and do not understand how to run a script.

Start() and Update() methods are causing errors. Am I correct in assuming you cannot use those?

How would I run the following test script?

using UnityEngine;
using System.Collections;

public class TestScript : MonoBehaviour
{
public void testMethod ()
{
Debug.Log("test");
}
}
  • edited April 2016
    You might find some help looking in the scripting section here and there is a scripting tutorial. What do you want your script to do?

    You have to include the ORK namespace up at the top of your script for starters.

    using ORKFramework;


    You can call a function in a script in an ORK event. I think the process there is to put the script on an empty game object in your scene and then fill in the event that calls a function.
    Post edited by Catacomber on
  • Thanks for the reply. I was able to call a function using the empty game object approach you recommended.

    It turns out that using ORKFramework isn't required just to call a function, but almost certainly is to interact with the framework.
  • Can someone explain how to use that call function node?
    I've put my script on an empty object in my scene but I can't get to make it run...
  • You have to put the name of your component in the Component Name field - i.e. the actual name in the script, not the one displayed in the inspector.

    The name of the function you want to call goes into the Function Name field. The function must be public, and you need to add the parameters (Add Parameter button) your function requires. Please note that not all parameter types are supported, only some basic stuff.

    To get the correct game object you want this to call on, add it as an actor in the event's settings - either use the Find Object functionality, or select the object in the inspector of your event interaction.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • I've got it to work!

    ══ (\../) ══
    ═ ( ◕.◕) ═══ Thank you!
    ══ (,)(,) ═══
Sign In or Register to comment.