First thing: I’m new. So I’m trying to build a virtual keyboard in Unity. I’m starting with one key, and one InputField.
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class KeyboardScript : MonoBehaviour {
InputField iField;
public void onClick() {
string key = "k";
iField.text(key);
}
}
Here’s how I interpret the code I wrote:
using UnityEngine.UI allows me to reference UI GameObjects.
InputField is the name of my input field and I let the computer know it is an iField.
This code is a component of my button which is called K, and so onClick() means when button K is clicked.
Let string called key equal letter k.
Let the text inside InputField equal k.
My error says "The member ‘UnityEngine.UI.InputField.Text’ cannot be used as method or delegate.
I appreciate any advice. I have looked at the Unity manuals and other things, I just need a human’s help because I don’t know what I’m looking at.
Thanks.