помогите пожалуйста в C# ошибка Assets\Script\Script.cs(72,2): error CS1513: } expected Скрипт: using System.Collections; using System.Collections.Generic; using UnityEngine;
public class PlayerControler : MonoBehaviour { public float speed; public float jumpForce; private float moveInput;
private Rigidbody2D rb;
private bool facingRight=true;
private bool isGrounded; public Transform feetPos; public float checkRadius; public LayerMask whatIsGround;
Assets\Script\Script.cs(72,2): error CS1513: } expected
Скрипт:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerControler : MonoBehaviour
{
public float speed;
public float jumpForce;
private float moveInput;
private Rigidbody2D rb;
private bool facingRight=true;
private bool isGrounded;
public Transform feetPos;
public float checkRadius;
public LayerMask whatIsGround;
private void Start()
{
animator=GetComponent<Animator>();
rb=GetComponent<Rigidbody2D>();
}
private void FixedUpdate()
{
moveInput=Input.GetAxis("Horizontal");
rb.velocity=new Vector2(moveInput * speed, rb.velocity.y);
if(facingRight == false && moveInput > 0)
{
Flip();
}
else if(facingRight == true && moveInput <0)
{
Flip();
}
}
private void Update()
{
isGrounded=Physics2D.OverlapCircle(feetPos.position,checkRadius,whatIsGround);
if(isGrounded == true && Input.GetKeyDown( KeyCode.Space ))
{
rb.velocity=Vector2.up * jumpForce;
{
animator.SetBool("isRunning", true);
animator.SetBool("isIdle", false);
{
animator.SetBool("isRunning", false);
animator.SetBool("isIdle", true);
}
if(!isGrounded)
{
animator.SetBool("isJumping", true);
}
else
{
animator.SetBool("isJumping", false);
}
}
}
void Flip()
{
facingRight=!facingRight;
Vector3 Scaler=transform.localScale;
Scaler.x *= -1;
transform.localScale=Scaler;
}
public class jumpPlayer : MonoBehaviour
{
private Rigidbody2D rb;
public float jumpForce = 5.0f;
void Awake()
{
rb = GetComponent<Rigidbody2D>();
}
void Update()
{
if (Input.GetKeyDown( KeyCode.Space ))
{
rb.AddForce(new Vector2(0, jumpForce), ForceMode2D.Impulse);
}
}
} }