Answers for "how to use input field unity"

15

unity how to get input

using UnityEngine;
using System.Collections;public class ExampleClass : MonoBehaviour
{
    public void Update()
    {
        if (Input.GetButtonDown("Fire1"))
        {
            Debug.Log(Input.mousePosition);
        }
    }
}
Posted by: Guest on March-29-2020
3

how to use input field unity

public string theName;
    public GameObject inputField;
    public GameObject textDisplay;
    
    public void StoreName()
    {
        theName = inputField.GetComponent<Text>().text;
        textDisplay.GetComponent<Text>().text = theName;
    }
Posted by: Guest on May-28-2021

Code answers related to "how to use input field unity"

Browse Popular Code Answers by Language