CaGi
Hectopat
- Katılım
- 13 Eylül 2020
- Mesajlar
- 146
Arkadaşlar oyun yapıyordum ve bu hata çıktı ne yapmam gerek.
Kod:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class KarakterKontrolu : MonoBehaviour
{
Rigidbody2D playerRb;
public float movespeed= 1f;
bool facingRight = true;
// 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);
if (playerRb.velocity.x < 0 && facingRight)
{
// yuzunu cevır
}
else if (playerRb.velocity.x < 0 && !facingRight)
{
// yuzunu cevır
}
}
void HorizontalMove()
{
//playerRb.velocity = new Vector2(Input.GetAxis("Horizontal"),),
}
void FlipFace()
{
facingRight = !facingRight;
Vector3 tempLocalScale = transform.localScale;
tempLocalScale.x *= -1
transform.localScale = tempLocalScale;
}
}