How can i make float u = 1 – t; ? I'm getting errors

Vector3 Test(float t)
{
float u = 1 – t;
}

I’m getting error on the ‘-’

Unexpected character '–'	

And Only assignment, call, increment, decrement, and new object expressions can be used as a statement

And error on the t:

; expected

Like @PersianKiller pointed out correctly your code does not contain a “normal minus” but an “en dash”. Only the normal minus sign is recognised as “minus operator”. The “en dash” is recognised as a normal character. So this should result in the same error and basically does the same:

float u = 1 foobar t;

Of course this doesn’t make much sense. This is not valid code as you have a “number” followed by two identifiers “foobar” and “t”.

Next thing is your method has Vector3 as return type. If a method has a return type you have to return a value of that type. Though it’s not clear what this method should do. That’s basically the next thing: Name your methods propertly so it becomes clear what the method does. Otherwise you could call all your methods “A0001” and “A4242”. The compiler doesn’t mind how you name it. The name should be useful for the programmer to understand the program.

There might be another error depending on where you put that code snippet.