- Home /
Toggling between two cameras/camera fix on fallout.
I'm having a bit of trouble with toggling between two camera angles on one character, from first person to third person, to be exact. I tried GameObject.GetComponent("ThirdPersonController").active = fasle;, but that toggles the entire character off. Any way to toggle or remove certain scripts on a character?
As for my second question, while in third person, my character falls off of the screen, -100, and the camera glitches out like so: http://theamazingsnivygames.eu.pn/
You can test the effects yourself using the webplayer on the page.
F1 switches the camera angles, and if you fall off of the side of the plane, you will see the camera glitch out.
It wouldn't fall off for me.
It sounds like you want two cameras, one first and one third and to toggle one or the other active.
Yeah, but the FirstPersonInput script is making the player slide around at crazy speeds.
Answer by TonyLi · Jul 29, 2013 at 02:11 AM
This disables a component without deactivating the game object:
MonoBehaviour.enabled = false;
For example:
GameObject.Find("Player").GetComponent<ThirdPersonController>().enabled = false;
(C# above, but JavaScript is similar.)
Hopefully if you get the cameras and/or control scripts enabled and disabled as desired your second issue will go away.
Your answer