error CS1955: Non-invocable member 'Vector3' cannot be used like a method. this is the code

if(Input.GetKey(“left ctrl”))
{
transform.localPosition = Vector3(0, -0.5, 0);
}
else
{
transform.localPosition = Vector3(0, 0, 0);
}

You’re missing the new keyword.transform.localPosition = new Vector3(0, -0.5f, 0);
When you run into an issue like this, try looking at other peoples’ examples to see the right way to do things.

4 Likes

This exactly ^^^

And when you post code, ALWAYS use code tags: https://discussions.unity.com/t/481379

How to report your problem productively in the Unity3D forums:

http://plbm.com/?p=220

PraetorBlue That gives me 2 errors

Post your code.