I am trying to create a space where player's can enter a name for their hero when they start a new game. Here is my code:
using UnityEngine;
using System.Collections;
public class Namespace : MonoBehaviour {
public string hero;
// Use this for initialization
void Start () {
hero = new string();
}
// Update is called once per frame
void Update () {
}
void OnGUI () {
GUI.Label(new Rect(10,10,50,25), "Enter Your Heroes Name:");
hero = GUI.TextArea(new Rect(65,10,100,25), hero);
}
}
_________________________________________________________________________________________
I get an error that says
Assets/Scripts (Medina)/Namespace.cs(9,36): error CS1729: The type `string' does not contain a constructor that takes `0' arguments
Any help is greatly appreciated :-)
↧