C# Scripting Method Name Expected Please Help

I was following a tutorial and then an error popped up saying method name expected. Can someone please help me fix this.
Here is my script:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Pixelperfectcamera : MonoBehaviour {
	
	public static float PixelsToUnits = 1f;
	public static float scale = 1f;

	public Vector2 nativeResolution = new Vector2 (240, 160);

	void Awake () {
		var camera = GetComponent <Camera> ();
Error is with this 1f here	1f (camera.orthographic); {
			scale = Screen.height/nativeResolution.y;
			PixelsToUnits *= scale; 
			Camera.orthographicSize = ((Screen.height / 2.0f) / PixelsToUnits);
	}
	

	}}

It is hard to see because the code formatting in your question has become all jumbled, but I think you have a syntax error in your code. This means that letters, symbols and numbers in your scripts are uninteligible to the compiler that needs to build your game into a working application.

If you copy pasted the code make sure you get everything, even the last little } because without it the compiler is mind-blown. If you are trying to learn c# and are reconstructing someones example then you need to very much understand the syntax of the c# language.

I see two things wrong with your code. But neither one explains exactly your error. First thing is you have an extra ‘;’ after your if condition which will compile but actually makes your if condition useless as it will be ignored in runtime. And secondly you are using Camera.orthographicSize when you should be using lowercase camera.orthographicSize. I am actually very surprised that you don’t get an error like, ‘Camera does not contain a definition for orthographicSize’. Since UnityEngine.Camera is the actual thing that is being referred to when you use capital Camera.

The error you are getting seems to suggest that the compiler found a method body like started with a ‘{’ but found no method name to name that method body. So seems like you may have a {} mismatch somewhere?

Try

    if (Camera.main.orthographic){
        scale = Screen.height / nativeResolution.y;
        PixelsToUnits *= scale;
        Camera.main.orthographicSize = ((Screen.height / 2.0f) / PixelsToUnits);
    }

if you want to use another camera you can reference it earlier in the script

private  Camera exampleCamera;

void OnEnable{
    exampleCamera = //however you want to load your camera;
}

then you can use

exampleCamera.orthographic

and

exampleCamera.orthographicSize

Thanks, this is my first try on unity and I will get back to you on weather it worked or not