Hello guys, I got an error with my script in unity: Assets/scripts/PlayerController.cs(69,17): error CS8025: Parsing Error.
Can you please help me. Sry if my english isn’t so perfect. I’m from germany
public float jumpPower = 10;
bool inputJump = false;
float velocity = 0;
Vector3 moveDirection = Vector3.zero;
CharacterController characterController;
SpriteController spriteController;
// Use this for initialization
void Start () {
characterController = GetComponent<CharacterController> ();
spriteController = GetComponent<SpriteController> ();
}
// Update is called once per frame
void Update () {
InputCheck ();
Move ();
SetAnimation ();
}
void InputCheck()
{
velocity = Input.GetAxis ("Horizontal") * speed;
if (Input.GetKeyDown (KeyCode.Space)) {
inputJump = true;
}
else
{
inputJump = false;
}
}
void Move()
{
if (characterController.isGrounded)
{
if (inputJump)
moveDirection.y = jumpPower;
}
moveDirection.x = velocity;
moveDirection.y -= gravity;
characterController.Move(moveDirection *Time.deltaTime);
}
void SetAnimation()
{
if (velocity > 0) {
spriteController.setAnimation (spriteController.AnimationType.goRight);
}
if (velocity < 0) {
spriteController.setAnimation (spriteController.AnimationType.goLeft);
}
}