using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.Runtime.InteropServices; using System.Security.Cryptography; using UnityEngine; public class Rocket : MonoBehaviour { Rigidbody rigidbody; // Start is called before the first frame update void Start() { rigidbody = GetComponent(); } // Update is called once per frame void Update() { ProcessInput(); } private void ProcessInput() { if (Input.GetKey(KeyCode.Space)) { rigidbody.AddRelativeForce(Vector3.up); } if (Input.GetKey(KeyCode.A)) { print("LeftPressed"); transform.Rotate(Vector3.forward); } else if (Input.GetKey(KeyCode.D)) { print("RightPressed"); transform.Rotate(-Vector3.forward); } } }