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);
}
}