Hi, question again.
I’m making a First Person game.
In a house I’ve some “Resident Evil” screens (Fixeds Cameras)
The script :
#pragma strict
var camera1 : GameObject;
var camera2 : GameObject;
function OnTriggerEnter (other : Collider) {
if (other.tag == "Player"){
camera1.gameObject.active = false;
camera2.gameObject.active = true;
}
}
function OnTriggerExit (other : Collider) {
if (other.tag == "Player"){
camera1.gameObject.active = true;
camera2.gameObject.active = false;
}
}
He disable the FPC Camera and activate the fixed camera when entering trigger.
BUT, i’m not able to move the character with the mouse when I’m on the fixed camera trigger.
How to keep the mouse control ?
Thanks ^^
Yes, sorry for late reply.
var cam1 : Camera; // Main camera
var cam2 : Camera; // Camera to be switched to
function Start() {
cam1.enabled = true; // Enable main camera at start
cam2.enabled = false; // Disable secondary camera
}
function Update() {
if (Input.GetKeyDown(KeyCode.C)) { // What button to be pressed
cam1.enabled = !cam1.enabled;
cam2.enabled = !cam2.enabled;
}
}
That’s for it.
Cam1 = main camera
Cam2 = camera to be switched too.
You should be able to switch and move now.
The problem is : I’ve a FPC and ALL the game use First Person view.
Only on one house I’ve planed to make 3 Statics Cameras.
When the camera on the NPC switch to the fixed one, my chracter still controlable BUT only with the WASD keys, not the mouse, so to turn around it’s impossible.
My only option is to control the character with WASD.