(CLOSED)how do i fix error CS1526 (CLOSED) ANSWERED

i got this error on a project im working on i stay up late and couldn’t fix it help

Assets/script/player physics.cs(61,15): error CS1526: A new expression requires () or after type

this is my script

using UnityEngine;
using System.Collections;


[RequireComponent (typeof(BoxCollider))]
public class playerphysics : MonoBehaviour {

	public LayerMask collisionMask;

	private BoxCollider collider;
	private Vector3 s;
	private Vector3 c;

	private float skin = .005f;

	[HideInInspector]
	public bool grounded;

	Ray ray;
	RaycastHit hit;


	void Start() {
		collider = GetComponent<BoxCollider>();
		s = collider.size;
		c = collider.center;
	}
		public void Move(Vector2 moveAmount) {

		float deltaY = moveAmount.y;
		float deltax = moveAmount.x;
		Vector2 p = transform.position;


		for (int i = 0; i<=3; i ++) {
			float dir = Mathf.Sign(deltaY);
			float x = (p.x + c.x - s.x/2) + s.x/2 * i; // Left,centre and then rightmost point of collider
			float y = p.y + c.y + s.y/2 * dir; // Bottom of collider

			ray = new Ray(new Vector2(x,y), new Vector2(0,dir));

			if (Physics.Raycast(ray,out Hit.Mathf.Abs(deltaY).collisionorMask)) {
	             //Get Distance between player and ground
				float dst = Vector3.Distance(ray.origin, hit.point);
			    //Stop player's downwards movement after coming within skin width of a collider
				if(dst > skin) {
					deltaY = dst + skin;
				}
				else {
					deltaY =0;
				}
				grounded = true;
				break;
			}
			
		}	
				

		        Vector2 finalTransform = new Vector2(deltax,deltaY
		        
      transform.Translate(finalTransform);
   }
}

Near the end of the Move function, you’re missing the closing parenthesis in the function call, and the semi-colon.

The line:

Vector2 finalTransform = new Vector2(deltax,deltaY

Should be:

Vector2 finalTransform = new Vector2(deltax,deltaY);

Welcome to Unity Answers!

First, a little help understanding the compiler error.

The first part of the error describes a location in a file:

Assets/script/player physics.cs(61,15)

In the file “player physics.cs”, at line 61, column 15. This isn’t necessarily the precise spot you have a problem, but it’s a good place to start looking.

The second part of the error is a machine-friendly error code:

error CS1526

That code is sometimes useful for lookups and searching (for example, here on Unity Answers, or in Google). It uniquely identifies the specific error you’re having.

Finally, the third part of the error is a human-friendly description:

A new expression requires () or [] after type

So, it looks like you’re calling a constructor with invalid syntax.

I do see one obvious problem:

Vector2 finalTransform = new Vector2(deltax,deltaY

The line above is missing a closing paren and a semicolon. It should probably look more like this:

    Vector2 finalTransform = new Vector2(deltax,deltaY);