Unity Ninja Unity 3D Forum
To have exclusive access to all downloads, recourses and links within this forum, a free registered account is required. Just a heads up Wink

You are not connected. Please login or register

Unity Ninja Unity 3D Forum » FREE Project Downloads & Recources » Scripts » Help making script to change from FPS to TPS

Help making script to change from FPS to TPS

View previous topic View next topic Go down  Message [Page 1 of 1]

1 Help making script to change from FPS to TPS on Mon Feb 16, 2015 10:38 pm

Gun6


Member [Lv. 0]
Member [Lv. 0]
I need help for making FPS camera to TPS, Help me with the scripts, I am Newbie

View user profile

VicTore UpZombieZ


Member [Lv. 2]
Member [Lv. 2]
Start the script with:

var 1st Person Cam : gameObject;
var 3rd Person Cam : gameObject;

thats all i know Smile

View user profile

Medieval Pictures


Member [Lv. 0]
Member [Lv. 0]
Add this script to an empty GameObject and assign the cameras in the editor.

var cam01 : GameObject; // first person
var cam02 : GameObject; // third person

//start with first person active
function Start() {
   cam01.gameObject.active = true;
   cam02.gameObject.active = false;
}

//check for the return keyDown
function Update() {

 if (Input.GetKeyDown ("return")) {

cam01.gameObject.active = false;
cam02.gameObject.active = true;

}

}


If you want to toggle between cameras using the same key you'll need to use an if statement and a boolean to check which camera is active.

View user profile

adnanss


Member [Lv. 3]
Member [Lv. 3]
hey i'm new in this website

View user profile http://www.unityninja.net

adnanss


Member [Lv. 3]
Member [Lv. 3]
please help me to make the fps game scripts.........

View user profile http://www.unityninja.net

View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum