Playmaker Forum

PlayMaker Feedback => Action Requests => Topic started by: westingtyler on June 22, 2020, 10:56:48 AM

Title: Game Object Switch
Post by: westingtyler on June 22, 2020, 10:56:48 AM
like a string switch. it checks if a desired game object is the same as one stored in the switch and sends an event based on that.

currently I need to get the game object's name, then compare it to a dozen strings of other names of game objects. but this means that I need to remember to manage the string switch if I change names of those game objects. this would make it way easier to maintain.
Title: Re: Game Object Switch
Post by: daniellogin on June 22, 2020, 11:28:33 AM
Maybe I don't understand, because I'm wondering why you don't just use Gameobject Compare: https://hutonggames.fogbugz.com/default.asp?W488
Title: Re: Game Object Switch
Post by: djaydino on June 22, 2020, 01:58:59 PM
Hi.
You can place your objects into an array then use 'Array Contains' then store the index.
That index you can then use with a int switch (depending on what you need to do you could also use a 2nd array with some values and get it with the stored index, then you would not need to use int switch)