Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: cdutoit on September 01, 2014, 06:04:29 PM

Title: Accessing array on another class from a FSM
Post by: cdutoit on September 01, 2014, 06:04:29 PM
Hello -

Struggling with something and looking for guidance/pointers. I'm relatively new to both PM and Unity so excuse my ignorance ;)

On my Main Camera game object, there is a 3rd party Script attached to it which has a public array on it amongst others.

Now, on another gameobject, inside my FSM, I want to add an element to that array on the camera object.

I know there is an ArrayMaker add-on, but I want to know how do I access that array on the other game object? In the script source code declaring the array, it is defined as public.

Any help appreciated.

Thanks
Title: Re: Accessing array on another class from a FSM
Post by: mdotstrange on September 01, 2014, 07:25:28 PM
Have you tried using the "get property" action? Drop the script with the array in there and see if you can access it
Title: Re: Accessing array on another class from a FSM
Post by: cdutoit on September 01, 2014, 09:07:24 PM
Thanks, mdotstrange.

I tried the get property thanks...but it seems it only returns primitive types. It doesn't let you "see" an array. So I can't use that unfortunately.

Can't believe I'm so stumped trying to accomplish something so simple :( I'll keep fighting it but if anyone has ideas, please share!
Title: Re: Accessing array on another class from a FSM
Post by: mdotstrange on September 01, 2014, 09:20:24 PM
Yeh sometimes its tough to get 3rd party scripts to interact with PM- most of the time I try to just rebuild the functionality with PM-

Perhaps you need another script that can add to the array? Then you can execute the script with PM by enabling/disabling it-

btw Arraymaker is pretty easy to use once you understand the basics if you want to rebuild the arrays functionality in PM