Assets\script\CharactherMove.cs(69,10): error CS1513: } expected hatası

toprakq

Femtopat
Katılım
7 Temmuz 2023
Mesajlar
16
Daha fazla  
Cinsiyet
Erkek
Kod:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CharacterMove : MonoBehaviour
{
    // Start is called before the first frame update
    public float moveSpeed;
    private Animator anim;

    private Rigidbody2D rb2d;
    float moveHorizontal;

    public bool facingRight;

    public float jumpForce;
    public bool isGrounded;
    public bool canDoubleJump;

    PlayerCombat playercombat;


    void Start()
    {
        moveSpeed = 5;
        moveHorizontal = Input.GetAxis("Horizontal");
        anim = GetComponent<Animator>();
        rb2d = GetComponent<Rigidbody2D>();
        playercombat = GetComponent<PlayerCombat>();

    }

    // Update is called once per frame
    void Update()
    {
        CharacterMovement();
        CharacterAnimation();
        CharacterAttack();
        CharacterRunAttack();
        CharacterJump();
    }

    void CharacterMovement()
    {
        moveHorizontal = Input.GetAxis("Horizontal");
        rb2d.velocity = new Vector2(moveHorizontal * moveSpeed, rb2d.velocity.y);
    }
    void CharacterAnimation()
    {
        if(moveHorizontal > 0)
        {
            anim.SetBool("isRunning", true);
        }
        if(moveHorizontal == 0)
        {
            anim.SetBool("isRunning", false);
        }
        if(moveHorizontal < 0)
        {
            anim.SetBool("isRunning", true);
        }
        if(facingRight == false && moveHorizontal > 0)
        {
            CharacterFlip();
        }
        if(facingRight == true && moveHorizontal < 0)
        {
            CharacterFlip();
        }
 

Dosya Ekleri

  • CharactherMove.cs - Microsoft Visual Studio 6.03.2024 19_35_00.png
    129,5 KB · Görüntüleme: 27
Son düzenleyen: Moderatör:
Köşeli parantez } ekle sona, 70. Satıra
 
Son düzenleme:
Bu siteyi kullanmak için çerezler gereklidir. Siteyi kullanmaya devam etmek için çerezleri kabul etmelisiniz. Daha Fazlasını Öğren.…