Выдает ошибку Assets\Scripts\Movement.cs(54,33): error CS1002: ; expected , что делать?
Но если я поставлю там где просят точку с запятой то у меня вылетают другая ошибка Assets\Scripts\Movement.cs(54,14): error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Movement : MonoBehaviour
{
[SerializeField] private Rigidbody2D rb;
[SerializeField] private float speed;
[SerializeField] private float jumpForce;
[SerializeField] private PlayerAnimations animator;
[SerializeField] private SpriteRenderer sprite;
public bool onGround;
public bool isMove;
private void OnTriggerStay2D(Collider2D collision)
{
onGround = true;
}
private void OnTriggerExite2D(Collider2D collision)
{
onGround = false;
}
public void Run(float direction)
{
if (direction>0)
{
sprite.flipX = false;
}
else
{
sprite.flipX = true;
}
var destination = transform.right * direction;
transform.position = Vector3.MoveTowards(transform.position, transform.position + destination, speed * Time.deltaTime);
}
public void Jump()
{
if (onGround == true)
{
rb.AddForce(transform.up * jumpForce);
}
}
private void Update()
{
if (isMove == true)
{
animator.Play( Animations.Run );
}
else if (onGround == true)
{
animator.Play(Animations.Idle);
}
else (onGround == false) <---(Вот здесь просять поставить точку с запятой)
{
animator.Play(Animations.Jump);
}
}
}
else if потому что