Calling a variable in C#?

Hey, so im trying to learn C#, i previously used Javascript so this is new to me. Im trying to call a variable that represents: “transform.right * 20” this is what i used.

public rgt transform.right * 20;

That doesnt work. What can i do to make this right?

You should declare the variable type before its name and place an = after it:

public Vector3 rgt = transform.right * 20;

But this would not work anyway because you can’t initialize member variables with game object properties: you should just declare the variable, then initialize it at Awake or Start:

public Vector3 rgt;

void Awake(){
  rgt = transform.right * 20;
}