How do I compare string in "compare two values"

  • Hi ,

    I've been tring to compare a text variable, kappavar, that for example stored "Kappa" as a string in the "compare two values" event.

    [kappavar == "kappa"]

    Most times it returned false and sometimes it did return true, but not because it was the same string.

    I know this because I listed many of the comparison events in the same group and all of them, with different strings comaprison, returned true!

    Right now I have it working like this:

    [-1 < find(kappavar,"kappa") Is there a better way to compare strings & text variable? Thanks!
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Code like this does not return false sometimes and sometimes true, when the values don't change. Go through your code again, you've probably made a mistake. Comparing a string like the way you want to has to work.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)