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)
{
//transform.eulerAngles = new Vector2(0, 0);
}
else if (playerRb.velocity.x < 0 && !facingRight)
{
//transform.eulerAngles = new Vector2(0, 180);
}
}
void HorizontalMove()
{
//playerRb.velocity = new Vector2(Input.GetAxis("Horizontal"),),
}
void FlipFace()
{
facingRight = !facingRight;
Vector3 tempLocalScale = transform.localScale;
tempLocalScale.x *= -1;
transform.localScale = tempLocalScale;
}
}