Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: hunter on April 09, 2019, 04:00:52 PM
-
I have a series of game objects, and each one is loading its' visuals from a different array variable.
I'm looking for a way that I can use a string to define the array variable each GO is looking at, so that I can just update a single instance of the name in each GO's FSM (rather than a dozen times in each Array Transfer Value action!).
I feel like there's either a super obvious solution I just don't know to look for, or my thinking is to backwards that this just isn't something more experienced designers need to do.
Any guidance would be much appreciated!
-
Hi.
Im not sure if i understand correctly. so bare with me if the answer wont help :)
You can use a 2nd array with the string values then use 'array contains' and search for the target string.
Store the index.
use that index on the array you have.
the index of both arrays should correspond with each other.
So element 0 on the string (for example GO1) array will correspond with element 0 on the other array.
Instead of strings you could also use 'gameobjects' if you are referring to gameobjects
-
I'm not sure I'm following - but I think I may have explained poorly!
Here is an image of the action I'm working with - and I'm hoping there's a way I can use a string (or something else - maybe a GO variable in a way I'm not understanding?) to define this value I highlighted, rather than having to set a specific array.
(http://)
-
Hi.
Ahh i understand now.
I would suggest using Array Maker instead as it uses references. (strings)
You can get Array Maker on the Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181)
-
Thanks for the advice! I've switched over to Arraymaker, and it's definitely going to do the trick.