How do I fix compiler errors that must be fixed before entering play mode?
How do I fix compiler errors that must be fixed before entering play mode?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerController : MonoBehaviour
{
public float speed = 5.0f;
public float turnSpeed;
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");
// Move the vehicle forward
transform.Translate(Vector3.forward * Time.deltaTime * speed * forwardInput);
transform.Rotate(Vector3.up, turnspeed * horizontalInput * Time.deltaTime);
}
}
Comment
Your answer
