I am trying to switch between a Boat and FPS Controller. I have cameras that I want to use with each controller and I only want them to be activated if that controller is activated. Can someone show me the script to make this work. Thanks.
// Boat.cs
public class Boat : Monobehavior {
/* Assuming that you set these two variables
to relative camera gameobjects…
*/
GameObject FPS_Controller_Cam;
GameObject Boat_Cam;
void OnEnable () {
FPS_Controller_Cam.SetActive (false);
Boat_Cam.SetActive (true);
}
}
// FSPController.cs
public class FPSController : Monobehavior {
/* Assuming that you set these two variables
to relative camera gameobjects...
*/
GameObject FPS_Controller_Cam;
GameObject Boat_Cam;
void OnEnable () {
Boat_Cam.SetActive (false);
FPS_Controller_Cam.SetActive (true);
}
}