Insert A name?

Hi guys, for my highscore script people should be available to type their name and i don’t know how i should probably get like a textbox you can edit in unity. Someone has a script or somthing like that?

ty in advance.

It’s pretty easy, try this code in JavaScript:

var _name: String;

function OnGUI() {
    
_name = GUI.TextField(Rect(10, 10, 200, 50), _name);
    
 }

or in C#:

private string _name;

void OnGUI() {

_name = GUI.TextField(new Rect(10, 10, 200, 50), _name);

}

In the same time that _name is the variable that hold the value of the TextField, it’s the editable value of it. (: