using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Rocket : MonoBehaviour
{
Rigidbody rigidBody;
// Start is called before the first frame update
void Start()
{
rigidBody = GetComponent<Rigidbody>();
}
// Update is called once per frame
void Update()
{
ProcessInput();
}
private void ProcessInput()
{
if (Input.GetKey(KeyCode.Space)) //can thrust while rotating
{
rigidBody.AddRelativeForce(Vector3.up*Time.deltaTime*60);
}
if (Input.GetKey(KeyCode.A))
{
transform.Rotate(Vector3.forward*Time.deltaTime*50);
}
else if (Input.GetKey(KeyCode.D))
{
transform.Rotate(-Vector3.forward*Time.deltaTime*50);
}
}
}