Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Shan-Go on January 13, 2025, 10:43:15 AM

Title: Problem with Conditional Expression
Post by: Shan-Go on January 13, 2025, 10:43:15 AM
Hello!

Have a problem with a string value in a Conditional Expression - it stays False no matter what.

Character in my game moves around a grid-based location. When user chooses a direction to move I do the following:

State 1 - get the name of the tile the user wants to move to
- Raycast to the chosen direction to check what tile lies ahead (ground, stair, wall, trap, etc.) - different tiles require different reaction from the character
- Save tile as tileDestination using Store Hit Object in Raycast action
- Use Get Name action to extract tile name from tileDestination variable and save it as a string in tileDestinationName

State 2 - check if tile name is "Ground"
- Use Conditional Expression to compare string value: tileDestinationName == "Ground"

And this is the moment I can't get through. This Conditional Expression returns False, even when tileDestinationName variable is Ground.

Am I using Conditional Expression wrong?
Title: Re: Problem with Conditional Expression
Post by: Shan-Go on January 15, 2025, 05:14:37 AM
Ok I tried String Compare action instead of Conditional Expression to compare string value. I did that to check if logic and variables are fine. And it works all right that way.

So I'm coming to the conclusion that problem lies in the expression syntax.

I still need to find out how to make work string comparison in Conditional Expression in order to use && and || operators for several strings at once.

If anyone have positive experience with using string comparison within Conditional Expression action please let me know. Any info is highly appreciated.