playMaker

Author Topic: Using Call / Invoke Method  (Read 1681 times)

zzap64

  • Playmaker Newbie
  • *
  • Posts: 38
Using Call / Invoke Method
« on: June 03, 2024, 05:00:32 PM »
I'm trying to obtain the GetLongitude variable value from this script into Playmaker:

 public static double GetLongitude()
   {
        #if UNITY_IOS

        if(Application.platform == RuntimePlatform.IPhonePlayer)
        {
            return getLongitude();
        }


Do I use Call  / Invoke Method action to obtain this? I've tried experimenting with it but am unable to succeed :/
Any pointers would be appreciated, thanks.
« Last Edit: June 03, 2024, 05:02:34 PM by zzap64 »

fromfame

  • Junior Playmaker
  • **
  • Posts: 82
  • Sloppy PM Veteran
Re: Using Call / Invoke Method
« Reply #1 on: June 04, 2024, 12:20:59 PM »
Call Methods are used when a script contains a function that playmaker can read.

In most cases it can't. So you have two options:

1) Drag the script from the inspector tab into the empty area inside a state where you place your actions. You can then Get or Set it's property. In this case select Get. Then you'll have options that may allow you to get that variable.

2) If the above doesn't work, copy that script and paste it into GPT asking it to allow you to be able to read it in playmaker. It may make a mistake or two. Trial and error, until you get it right. This usually takes a minute at best.

Hope that helps you.

zzap64

  • Playmaker Newbie
  • *
  • Posts: 38
Re: Using Call / Invoke Method
« Reply #2 on: June 05, 2024, 01:14:38 PM »
Thanks mate,

The script drag doesnt work for me :/ however, i'm trying out some scripts with C-GPT and hopefully that guides me. I'll update on my progress.
Thanks for the reply , appreciate it :)