- Home /
Question by
Brennan · Aug 07, 2010 at 06:58 AM ·
guibuttonthird-personfirst-person
How to make a button that switches from 3rd person mode to first person mode?
I want to make a gui button with a script when u click it it changes cameras... how do i fix?
Comment
Best Answer
Answer by TaigaStudios · Aug 07, 2010 at 08:31 AM
As Duck posted to a similiar question you can switch between cameras by setting camera's enabled property true or false.
var cam1 : Camera;
var cam2 : Camera;
function Start() { cam1.enabled = true; cam2.enabled = false; }
function Update() {
if (Input.GetKeyDown(KeyCode.C)) {
cam1.enabled = !cam1.enabled;
cam2.enabled = !cam2.enabled;
}
}
next time try searching before posting, I found the reference link by just typing changing cameras into the search field.
reference : Duck
Your answer
Follow this Question
Related Questions
Move GUI elements. 0 Answers
Can I use a movie texture with alpha as a GUI object? 1 Answer
Using GUI and check what button was pressed 1 Answer
GUI Button for Android 1 Answer