Global Game Jam 2023
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

35 lines
804 B

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CubeTestController : MonoBehaviour
{
[SerializeField]
private float forwardSpeed = 1;
[SerializeField]
private float turningSpeed = 90;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
Vector3 _pos = transform.position;
_pos += transform.forward * forwardSpeed * Time.deltaTime;
if (Input.GetKey(KeyCode.A))
transform.Rotate(new Vector3(0, -turningSpeed * Time.deltaTime, 0));
if (Input.GetKey(KeyCode.D))
transform.Rotate(new Vector3(0, turningSpeed * Time.deltaTime, 0));
transform.position = _pos;
}
}