using UnityEngine;
using System.Collections;
public class GetInOutShip : MonoBehaviour {
//Variables
bool inShip = false;
public Camera camera;
public ShipController shipController;
public FirstPersonController firstPersonController;
public GameObject ship;
public GameObject player;
public Transform cameraTransform;
void Start () {
inShip = false;
player.SetActive (true);
ship.SetActive (true);
GameObject.Find ("Spacship_vehicle").GetComponent<ShipController> ().enabled = false;
GameObject.Find ("Player_player").GetComponent<FirstPersonController> ().enabled = true;
cameraTransform = Camera.main.transform;
}
void Update () {
if (Input.GetKeyDown (KeyCode.P)) {
Invoke ("IntoShip", 0);
}
}
void IntoShip() {
Debug.Log ("Entered the Ship");
GetComponent<FirstPersonController> ().enabled = false;
GetComponent<ShipController> ().enabled = true;
inShip = true;
cameraTransform.parent = transform;
}
void ExitShip () {
Debug.Log ("Left the Ship");
}
}
The error is on line 41. Someone please help i dont have a clue?