Unity "syntax error, ',' expected" hatası

  • Konuyu başlatan CaGi
  • Başlangıç Tarihi
  • Mesaj 11
  • Görüntüleme 1B

CaGi

Hectopat
Katılım
13 Eylül 2020
Mesajlar
146
Arkadaşlar oyun yapıyordum bu sorun çıktı.
Kod:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerController : MonoBehaviour
{
    Rigidbody2D playerRB;
    public float moveSpeed - 1f;
               
void Awake()
{


}

    // Start is called before the first frame update
    void Start()
    {
        playerRB = GetComponent<Rigidbody2D>();
    }
   
    // Update is called once per frame
    void Update()
    {
        playerRB.Velocity =  new Vector2(Input.GetAxis("Horizontal") * moveSpeed, playerRB.velocity.y);
    }
    void FixedUpdate()
    {

    }
    void HorizontalMove()
    {


        //playerRB.velocity = new Vector2(Input.GetAxis("Horizontal"),);
    }
}
 
Şu satırda gibi bir bilgi yok mu?
1616510148773.png

Hatanın tam metnini paylaşır mısınız?

Paylaştım bakar mısınız?
 
C#:
using UnityEngine;

public class PlayerController : MonoBehaviour
{
    Rigidbody2D playerRB;
    public float moveSpeed = 1f;
    void Start()
    {
        playerRB = GetComponent<Rigidbody2D>();
    }
    void Update()
    {
        playerRB.velocity = new Vector2(Input.GetAxis("Horizontal") * moveSpeed * Time.deltaTime, playerRB.velocity.y);
    }
    void HorizontalMove()
    {
        //playerRB.velocity = new Vector2(Input.GetAxis("Horizontal") * 6f * Time.deltaTime, 0);
    }
}
 
Arkadaşlar, çözümü tüm kodları yeni dosya oluşturup hepsini ona yazmak (Kopyala yapıştır işe yaramıyor onu söyleyeyim).
 
Son düzenleyen: Moderatör:

Geri
Yukarı