Player:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class moverocket : MonoBehaviour {
public Rigidbody rb;
public float rocketmove;
public float rocketleft;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void FixedUpdate () {
if (Input.GetKey("w") ); {
rb.AddForce(0, rocketmove, 0);
}
if (Input.GetKey ("a"))
; {
rb.AddForce (rocketleft, 0, 0);
transform.Rotate (-50, 0, 0);
}
}
}
Camera:
using UnityEngine;
public class camerafollow : MonoBehaviour {
public Transform player;
public Vector3 offset;
// Update is called once per frame
void Update () {
transform.position = player.position + offset;
if (Input.GetKey (KeyCode.LeftArrow))
;
{
transform.Rotate (-5, 0, 0);
}
}
}