Create a Playername on new UI System

Hello!
I have an InputField with a child ‘Text’ on it.

When I press Play and write anything into that Text, and I click on Create, I get this error:
NullReferenceException: Object reference not set to an instance of an object

Here is my code:

    	private Text playerName;
    
    
    public void CreateCharacterButton(){
    	playerName = transform.FindChild ("EnterNameButton").FindChild("InputField").FindChild("EnterNameText").GetComponent<Text> ();
    		
    
    //when using this, I get a "Cannot implicitly convert type `UnityEngine.UI.Text' to `string'" (just btw)
    	// playerName.text = playerName;
    
    CreateNewPlayer();
    StoreNewPlayerInfo();
    SaveInformation.SaveAllInformation();
    }
    	private void StoreNewPlayerInfo(){
    		GameInformation.PlayerName = newPlayer.PlayerName;
    }
    
    	void CreateNewPlayer(){
    		newPlayer.PlayerName = playerName;
                }
}

to see code better:
http://hastebin.com/kawoyaxubi.cs

Does anyone know why it is not working? I attached the script onto my Canvas and childed it till my Text Component of the InputField…

I think you should use UI.Text, not Text. Then make sure you attach the component. Also in line 20 change from

playerName

to

playerName.text

EDIT:
Line 5 should look like this:

playerName = transform.FindChild (“EnterNameButton”).FindChild(“InputField”).FindChild(“EnterNameText”).GetComponent();