Ive been trying to create a simple moving script for a small game, and it keeps giving me a parsing error… from what I keep thinking is a closing bracket. Simply I need help, and all is much appreciated!
My error:
Assets/Scripts/Bounce.cs(58,25): error CS8025: Parsing error
Heres the script:
using UnityEngine;
using System.Collections;
public class Bounce : MonoBehaviour {
float lerpTime;
float currentLerpTime;
float perc =1;
Vector3 startPos;
Vector3 endPos;
boo1 firstInput;
public boo1 justJump;
void Update ()
{
if (Input.GetButtonDown (“up”) || Input.GetButtonDown (“down”) || Input.GetButtonDown (“left”) || Input.GetButtonDown (“right”)) {
{
if (perc == 1) {
{
lerpTime = 1;
currentLerpTime = 0;
firstInput = true;
justJump = true;
}
}
startPos = gameObject.transform.position;
if (Input.GetButtonDown (“right”) && gameObject.transform.position == endPos) {
endPos = new Vector3 (transform.position.x + 1, transform.position.y, transform.position.z);
}
if (Input.GetButtonDown (“left”) && gameObject.transform.position == endPos) {
endPos = new Vector3 (transform.position.x - 1, transform.position.y, transform.position.z);
}
if (Input.GetButtonDown (“up”) && gameObject.transform.position == endPos) {
endPos = new Vector3 (transform.position.x, transform.position.y, transform.position.z + 1);
}
if (Input.GetButtonDown (“down”) && gameObject.transform.position == endPos) {
endPos = new Vector3 (transform.position.x, transform.position.y, transform.position.z - 1);
}
if (firstInput == true) {
{
currentLerpTime += Time.deltaTime;
perc = currentLerpTime / lerpTime;
gameObject.transform.position = Vector3.Lerp (startPos, endPos, perc);
if (perc > 0.8)
{
perc = 1;
}
if(Mathf.Round (perc) == 1)
{
justJump = false;
}
}
}
}