- Home /
movement disable when camera changes view
hi, im a student who just started using unity, i am making a shooting game that allows players to change between first and thrid person view, i managed to get the cameras to change miraculously but when i change to third person view and then back to first person view the controls do not work anymore.
and i am not very good at coding so i was wondering if someone could help guide me.
the code that i am using is: var cam1 : Camera;
var cam2 : Camera;
function Update () {
if(Input.GetKeyDown("1")){
cam1.enabled = true;
cam2.enabled = false;
}
if(Input.GetKeyDown("2")){
cam1.enabled = false;
cam2.enabled = true;
}
}
Please also post the script you use for your controls, because the problem is not with the camera script you posted here.
i used the third person controller script that was in unity
What type of 3rd person view are you trying to achieve? Like Gears of War (or like the Boot Camp demo) or like Zelda and Lerpz? If its like Boot Camp just use the FPS controller, ins$$anonymous$$d of the 3rd person controller.
i tried using fps controller and it works so i guess i will stick with it