Inputfield text to String variable

Hello!

So what I’m trying to do is pretty much explained above, I just want to make a sting variable equal to the InputField’s text. So this is my code:

function Name(n: UI.InputField){
name = n.text;
}

This function is called by the Inputfield with the EndEdit function.

And this is the error I get:

BCE0031: Language feature not implemented: Ambiguous(AirportController.name, UnityEngine.Object.name).

After some searching I understand that Im missing a “()” somewhere but I dont know where!

Any help please??? :slight_smile:

You’re not missing any brackets; it’s that when you assign name = n.text, the compiler can’t work out what name is.

You’ve declared your own var name, but one also exists in the UnityEngine.Object base class, and so it’s impossible to know which one you mean in the current scope. Try renaming your name to something else (say, AirportName or _name or similar).