[Get currency from a array]

MenSoft

New member
Hi,

Im having a array with the type of Gameobject and it seems like I cant get the currencyValue from that array, if I instead just use "Get currency" everything works fine.
I'll attach some pictures for you to see the problem.
Working: (Im just putting the Player from the hierarchy in the action under Target game object)
1646051024640.png

And now to the problem. I want to be able to have a array to check different inventories.

So what I did was first to create a Array with the "Gameobject" type and then I just put the Player from the hierarchy into the array. (For testing)
1646050704818.png

After that I create a playmaker state that will get that array, and then I try another "Get currency" but with the result from the "Array get" and as you can see in the picture, I get the same "Gameobject" but it still wont work. It will just show "0" in the currency.
1646050941971.png
 
I see, I didn't think about changing the target gameobject at runtime.
I do the same mistake in most actions. I'll move all of the awake function contents within the OnEnter function to avoid that problem.
 
Top