HELLO TO ALL. I SEEMS THAT I KEEP GETTING THE COMPILER ERROR cs1022. th
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CharacterController : MonoBehaviour
{
public float jumpheight;
public float groundDeceleration;
Vector2 velocity;
public float MoveSpeed = 5f;
public float walkAcceleration = 2f;
Animator animator;
SpriteRenderer sprite;
Rigidbody2D rb;
public float Movespeed;
float Movement = (Input.GetAxisRaw("Horizontal"));
void Start()
{
sprite = GetComponent<SpriteRenderer>();
animator = GetComponent<Animator>();
rb = GetComponent<Rigidbody2D>();
}
void FixedUpdate()
{
velocity.y += Physics2D.gravity.y * Time.deltaTime;
velocity.x = Mathf.MoveTowards(velocity.x * MoveSpeed * walkAcceleration * Time.deltaTime);
if(movement != 0 && Input.GetButtonDown("a") )
{
velocity.x = Mathf.MoveTowards(velocity.x * MoveSpeed * walkAcceleration * Time.deltaTime);
}
else if(movement != 0 && Input.GetButtonDown("d"))
{
velocity.x = Mathf.MoveTowards(velocity.x * MoveSpeed * walkAcceleration * Time.deltaTime);
}
else
{
velocity.x = Mathf.MoveTowards(velocity.x, 0, groundDeceleration * Time.deltaTime);
}
Collider2D[] collider = Physics2D.OverlapBoxAll(transform.position, boxCollider.size = 0);
}
}
}
any help is much appreciated.