so me and my friend are making a app and im working on the coding im not sure if my code is correct apparently there are parsing errors but i dont see them. I need help please
using UnityEngine;
using System.Collections;
[RequireComponent(typeof(PlayerPhysics))]
public class playerinput : MonoBehaviour {
//Player Handling
public float speed = 8;
public float acceleration = 12;
private float currentSpeed
private float targetSpeed
private Vector2 amountToMove;]
private PlayerPhysics playerPhysics;
void Start () {
playerPhysics = GetComponent<PlayerPhysics> ();
}
void Update () {
targetSpeed = Input.GetAxisRaw ("horizontal") * speed;
currentSpeed = IncrementTowards (currentSpeed, targetSpeed, acceleration);
}
//Increase n towards target speed
private float IncrementTowards(float n, float target, float speed) {
if (n == target) {
return n;
}
else {
float dir = Mathf.Sign (target - n); // must n be increased or decreased to get closer to target
n += speed * Time.deltaTime * dir;
return (dir == Mathf.Sign (target - n)) ? n : target; //if n has now passed target then return target otherwise returm n
}
}
}