Search code examples
unity-game-engineinput-field

Unity check if inputfield is equal to a word?


I'm a bit new to Unity, and i just want to know, how can i check if an inputfield is equal to a word or some kind of code, or what i specify?

I tried whith something like:

if(inputfield == "Money")

but i didn't see it working:D


Solution

  • You just need to call the text portion of it

    if (inputfield.text == "Money")