Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: SlimeyOoze on February 23, 2022, 09:55:01 AM

Title: Checking against a String Variable
Post by: SlimeyOoze on February 23, 2022, 09:55:01 AM
Hello,

I'm trying to get 1 Switch Event check against 2 possible answers but can't see how?

In an if statement I would do

if(mySwitch == "unassigned" || mySwitch == "Left"
{
   ...Then do this
}

I guess I'm asking how I would go about placing an "OR" in Play Maker? either via a Switch or If Statement.

Currently I have a Switch event checking against UP, DOWN, LEFT & RIGHT but at the start the string variable isn't unassigned.

Thank You.


Title: Re: Checking against a String Variable
Post by: SlimeyOoze on February 23, 2022, 10:04:08 AM
Would it be "String Compare"?
Title: Re: Checking against a String Variable
Post by: Athin on February 23, 2022, 05:21:54 PM
Heya,

Yes String compare will be the one to use here as I can't remember if there is a switch action for strings.  You'll need the first string compare to check against the value Unassigned with a match flowing to another state.  Otherwise it will go to the second compare checking against Left and having it go to where you want from there.
Title: Re: Checking against a String Variable
Post by: SlimeyOoze on February 23, 2022, 06:01:29 PM
Thank you Athin