if statement not working for user input

The code already recognises the user input and says it in text but it doesn’t respond to if statements, anyone got any idea what’s causing it to not work,

		if  (userInput == "James")
		{ textComponent.text = "Sorry we already have someone named that";}

Edit: By the way theres also an else part and that works

		else   { textComponent.text = "Okay, That checks out.";}

If userInput really holds the string “James”, then the Sorry text should be displayed. Add Debug.Log("User Input is " + userInput); right before your if statement and find out if it really has “James” in it. My guess is that userInput is not representing what you think it is. Log is your friend in finding out. Hope that helps!