I'm getting this error and I don't know how to fix it
Assets/Scripts/PlayerController.cs(51,9): error CS8025: Parsing error
using UnityEngine;
using System.Collections;
public class PlayerController : MonoBehaviour {
public float moveSpeed;
public float jumpHeight;
public Transform groundCheck;
public float groundCheckRadius;
public LayerMask whatIsGround;
private bool grounded;
private bool doubleJump;
// Use this for initialization
void Start(){
}
void FixedUpdate(){
if (grounded = Physics2D.OverlapCircle (groundCheck.position, groundCheckRadius, whatIsGround));
}
// Update is called once per frame
void Update () {
if (grounded){
doubleJump = false;
}
if (Input.GetKeyDown (KeyCode.W) && grounded) {
GetComponent ().velocity = new Vector2 (GetComponent ().velocity.x, jumpHeight);
Jump ();
}
if (Input.GetKeyDown (KeyCode.W) && !doublejump && !grounded) {
GetComponent ().velocity = new Vector2 (GetComponent ().velocity.x, jumpHeight);
doubleJump = true;
if (Input.GetKey (KeyCode.D)) {
GetComponent ().velocity = new Vector2 (moveSpeed, GetComponent ().velocity.y);
}
if (Input.GetKey (KeyCode.A)) {
GetComponent ().velocity = new Vector2 (-moveSpeed, GetComponent ().velocity.y);
}
}
}
↧