Playmaker Forum

Playmaker News => General Discussion => Topic started by: odthiago on November 12, 2018, 07:45:38 PM

Title: Call static method[SOLVED]
Post by: odthiago on November 12, 2018, 07:45:38 PM
Hi, people

Im trying to call a static method (Call Static Method - Action) but rise this error:
"Invalid Method Name or Parameters:"

I bought the "Exploder" Asset and the script of the demo scene call the static method GetInstance().

Code: [Select]
public class ExploderSingleton : MonoBehaviour
...
...
private static ExploderObject Instance;

public static ExploderObject GetInstance(){
   return Instance;
}

void Awake(){
            Instance = gameObject.GetComponent<ExploderObject>();
}

What can I do?
Hope you understand...

Thx a lot,
Thiago from Brazil


Title: Re: Call static method
Post by: jeanfabre on November 12, 2018, 10:50:25 PM
Hi,

 can you make a screenshot of your action, are you setting the storeResult properly?

Bye,

 Jean
Title: Re: Call static method
Post by: odthiago on November 13, 2018, 04:22:17 AM
Hi, Jean

Thx your support!! Sorry my coupled FSM, Im decoupling it slowly!

What am I doing wrong?

Thx a lot!
Thiago
Title: Re: Call static method
Post by: odthiago on November 13, 2018, 05:47:11 PM
Hi, Guys

My bad! The script ExploderSingleton wasn´t attached to the prefab.
Its working! Now the body parts of BOT is blowing up.

Sorry my inattention!

Thx a lot,
Thiago from Brazil