- Home /
Question by
TheDreRock · Dec 26, 2015 at 11:12 AM ·
scripting problemerror
The type or namespace name x could not be found...
I do understand that many people have posted about this, but none of the answers have helped D:
I am basically trying to get information from an Input Field into a C# script so that the script can use it, and text out the functionality of it.
The error is on line 4 regarding the name "InputField". I do know for sure that this script is in the scene, and when I take it off of 'using' and just let it go on it's own, I get the exact same error but on what is shown here as line 9.
using UnityEngine;
using System.Collections;
using System;
using InputField;
public class TextField : MonoBehaviour {
public class test : MonoBehaviour {
void Start ()
{
var input = gameObject.GetComponent<InputField>();
var se= new InputField.SubmitEvent();
se.AddListener(SubmitName);
input.onEndEdit = se;
}
private void SubmitName(string arg0)
{
Debug.Log(arg0);
}
}
}
if anyone can help please let me know, and I'm very new to unity so it might be something really small haha... thanks for any help!
Comment
Update: The problem was solved by adding using UnityEngine.UI; to my using line, and removing using InputField; from it. Thanks anyway!
Your answer
![](https://koobas.hobune.stream/wayback/20220612053909im_/https://answers.unity.com/themes/thub/images/avi.jpg)