Sunday, October 16, 2022
HomeGame Developmentunity - How do I take advantage of an InputField to get...

unity – How do I take advantage of an InputField to get names of gamers?


I’m making a card-game the place initially the gamers have to put in writing their names into an InputField. These names are then used within the sport. My Downside is I eather get virtually all compiler errors in existance or I cant add the InputField to the script.
I`ve rewritten it aigan and aigan and that is how it’s rn: I’m printing out the names in an Debug.Log, simply to examine if the code will get the names (it doesnt). I’m planning on placing the names in an Array however in the meanwhile that additionally offers extra error codes then google is aware of.

utilizing System;
utilizing System.Collections;
utilizing System.Collections.Generic;
utilizing System.IO;
utilizing UnityEngine;
utilizing UnityEngine.UI;
utilizing UnityEngine.SceneManagement;

public class namen : MonoBehaviour
{

    public InputField inputNames; //Provides the InputField
    public Button addButton;      //Provides the addButton
    public Button continueButton; //Provides the continueButton


    public void getNames()
    {
        Debug.Log(inputNames.textual content);
    }

}

Any concepts how I can repair this drawback?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments