Search Unity

String Not Being Compared Correctly

Discussion in 'Scripting' started by cornelius_2, Sep 22, 2014.

  1. cornelius_2

    cornelius_2

    Joined:
    Apr 28, 2013
    Posts:
    2
    I cannot get any strings to compare from an array. I wrote a PHP script that queries an mysql database and using the WWW class I echo them back and fill an array. Can someone please let me know What I am doing wrong. It works with other scripts that I have made. I have started all over again and tried it with different methods. please see the sample code and yes I declared plantType : String = ""; I have even tried plantType.ToString(); I have manually set plantType to "Saw Mill" and it still got caught in my else statement.
     

    Attached Files:

  2. cornelius_2

    cornelius_2

    Joined:
    Apr 28, 2013
    Posts:
    2
    Nvm, I found the problem. The IF statement is true once then the variable clears and the condition is not longer true. I should really debug better. Than you.