Unity "Input axis vertical is not setup" hatası

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

CaGi

Hectopat
Katılım
13 Eylül 2020
Mesajlar
146
Arkadaşlar bu hatayı aldım çözebilecek var mı?

1616860011426.png


Kod:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class KarakterKontrolu : MonoBehaviour
{
       Rigidbody2D playerRb;
       Animator playerAnimator;
     public float movespeed= 1f;
     public float jumpSpeed = 1f;

     bool facingRight = true;


    // Start is called before the first frame update

    void Start()
    {
         playerRb = GetComponent<Rigidbody2D>();
         playerAnimator = GetComponent<Animator>();
    }

    // Update is called once per frame
    void Update()
    {
        HorizontalMove();

      
         if (playerRb.velocity.x < 0 && facingRight)
         {

             FlipFace();
         }
         else if (playerRb.velocity.x > 0 && !facingRight)
         {

             FlipFace();
         }

         if (Input.GetAxis("vertical") > 0)
         {
            Jump();
         }

    

      
    }
    void HorizontalMove()
    {
        playerRb.velocity = new Vector2(Input.GetAxis("Horizontal") * movespeed ,playerRb.velocity.y);
        playerAnimator.SetFloat("playerSpeed", Mathf.Abs(playerRb.velocity.x));
    }
    void FlipFace()
    {
        facingRight = !facingRight;
        Vector3 tempLocalScale = transform.localScale;
        tempLocalScale.x *= -1;
        transform.localScale = tempLocalScale;
    }

    void Jump()
    {
      
        playerRb.AddForce(new Vector2(0f,jumpSpeed));


    }
}
 
Unity arayüzünden Edit --> Settings --> Input kısmına girip axes kısmından negatif ve pozitif tuş seçmen gerekiyor





Şuradaki gibi yapabilirsin;
InkedScreenshot_8_LI.jpg
 
Evet ama burada takıldım.
Anladığım kadarı ile "Yatay" adında iki girişiniz var ve "Dikey" adında hiçbir girişiniz yok. Yani 2 horizantal giriş yapmışsın ama vertical giriş yapmamışsın bende pek anlamam yazılımdan açıkçası. Öğrenmeye çalışıyorum birşeyler.
 

Geri
Yukarı