Hi, basically i want to be able to enter/ exit my jet i made in photon cloud, currently you can but only on player can be in the vehicle.
Here is the current code:
using UnityEngine;
using System.Collections;
public class Jet_Entre : MonoBehaviour {
public GameObject Player;
public Jet_Network Jetwork;
public Jet jet;
public Jet_Cam Cam;
public bool CanEnter = false;
void Start(){
}
void OnTriggerEnter(Collider other){
if(other.gameObject.tag == "Player"){
Player = other.gameObject;
CanEnter = true;
}
}
// Use this for initialization
void OnTriggerExit(Collider other){
Player = null;
CanEnter = false;
}
// Update is called once per frame
void Update () {
if(Input.GetKeyDown(KeyCode.F)&& CanEnter == true){
Jetwork.enabled = true;
Player.SetActiveRecursively(false);
Player.transform.parent = gameObject.transform;
// jet.enabled = true;
Cam.enabled = true;
}
if(Input.GetKeyDown(KeyCode.R)){
Player.transform.localPosition = new Vector3(0,3,0);
jet.enabled = false;
Cam.enabled = false;
Jetwork.enabled = false;
Player.SetActiveRecursively(true);
Player.transform.parent = null;
Player.transform.rotation = new Quaternion(0,90,0,0);
}
}
}
Can someone help me make it so more than one person can be in the jets.
Thanks ![]()