Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: sachaMagne on April 02, 2013, 06:27:06 AM

Title: (uniksy)how do i translate a find component and call its method?
Post by: sachaMagne on April 02, 2013, 06:27:06 AM
Hi,
I just started playing with PM and wanted to translate unisky instance into a fsm.

The code is classic:
Code: [Select]
private UniSkyAPI uniSky;
private float timeOfDay;
private float speedOfTime = 0.4f;

public void Awake() {

// Define instance
GameObject uniSkyObject = GameObject.Find("UniSkyAPI");

uniSky = (UniSkyAPI) uniSkyObject.GetComponent(typeof(UniSkyAPI));
// Initiate and create default UniSky
uniSky.InstantiateUniSky();
I could find the game object and store it but can't figure how to access to InstantiateUniSky() and the others methods.

Thanks for your enlightenment
Title: Re: (uniksy)how do i translate a find component and call its method?
Post by: jeanfabre on April 03, 2013, 02:11:28 AM
Hi,

you can use the action "sendMessage" or the action "invoke" have you tried that?

bye,

 Jean