using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerController : MonoBehaviour.
{
public float speed = 20f;
public float turnSpeed = 45f;
public float horizontalInput;
public float forwardInput;
// Start is called before the first frame update.
void Start()
{
}
// Update is called once per frame.
void Update()
{
horizontalInput = Input.GetAxis("Horizontal");
forwardInput = Input.GetAxis("Vertical");
//araba ileri hareket. Parantez içine 0, 0, 1 yazsan da olur ama böyle daha kolay. * Time.deltaTime * 20 ile saniyede 60 değil 20 metre(kare) gidecek olarak ayarladık.
transform.Translate(Vector3.forward * Time.deltaTime * speed * forwardInput);
transform.Rotate(Vector3.up * Time.deltaTime * turnSpeed * horizontalInput);
}
}