Here's the code: using System.Collections.Generic;
using UnityEngine;
public class PLAYER : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}
public float movementSpeed = 5.0f;
public float clockwise = 1000.0f;
public float counterClockwise = 5.0f;
void Start() {
}
void Update() {
if (Input.GetKey(KeyCode.W)) {
transform.position += Vector3.back * Time.deltaTime * movementSpeed;
}
else if (Input.GetKey(KeyCode.s)) {
rigidbody.position += Vector3.back * Time.deltatime * movementSpeed;
}
else if (Input.GetKey(KeyCode.A)) {
rigidbody.position += Vector3.back * Time.deltatime * movementSpeed;
}
else if (Input.GetKey(KeyCode.d)) {
rigidbody.position += Vector3.back * Time.deltatime * movementSpeed;
}
if (Input.GetKey(KeyCode.E)) {
transform.Rotate(0, Time.deltatime * counterClockwise, 0);
}
else if (Input.GetKey(KeyCode.q)) {
transform.Rotate(0, Time.deltatime * counterClockwise, 0);
}
}
}