Best way to handle set / get event property?
Code the action.
You may wonder if this is hard. At first yes, a bit, but just pick an already existing action that does something like, say, set a float value, and see how it works (double click on it and launch the code editor associated to Unity, either Mono or the new Microsoft tool). The c# (C Sharp) syntax is relatively simple enough to understand for simple functions.
You'll need the Unity API scripting documentation available on the website.
Whereas you can set values in Unity by typing
myfloat = 2f;
in Playmaker actions you need to use the name of your variable and add
.Value
behind it so it looks like this:
myfloat.Value = 2f;
= sets the value of a variable.
It's literally written with the following logic:
"My variable's value is now equal to [value]."
It's different from
verifying if a variable has a given value (usually inside '
if then' etc. nested sections inside a script). For verification, the syntax would require using
== (is it equal to?).
Taking a look at the beginner level video tutorials on Unity's website will give you the basics you need to know.
If you take time going through this, you'll save yourself needless anxiety you'd feel by wondering if the program will work flawlessly with those get/Set actions.
As for arrays, it's really up to your preferences.
You can use an Array List (proxy) component on a game object or use the Array type variable inside the FSM (create an Array var and then decide what it is going to store).
A thing not obvious to users of Array Lists is that although you can preset a given number of items, they will all be of the same type. BUT it does not mean you cannot add items of other types too. When would such a case occur?
Well, when for example you use a short Array List to store half a dozen variables of different types, relative to an object, an element of your scene, perhaps one you'd instantiate too.
Say a character/player name, sprite for avatar, some ints and floats regarding attributes, etc.
However you will have to add those elements through "code" because you can't do that manually, since PM will only allow you to define a single type of variables for all the items you'd preset in your Array List.