Quantcast
Channel: Questions in topic: "cs1729"
Viewing all articles
Browse latest Browse all 10

Creating a Space to Type a Name

$
0
0
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 :-)

Viewing all articles
Browse latest Browse all 10

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>