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
Share
Go down
Member [Lv. 0]
Member [Lv. 0]
Posts : 1
Points : 1299
Rep : 0
Join date : 2014-12-30
View user profile

Help making script to change from FPS to TPS

on Mon Feb 16, 2015 10:38 pm
I need help for making FPS camera to TPS, Help me with the scripts, I am Newbie
Member [Lv. 2]
Member [Lv. 2]
Posts : 12
Points : 1352
Rep : 1
Join date : 2014-12-01
Age : 17
Location : Long Beach, CA
View user profile

Re: Help making script to change from FPS to TPS

on Tue Feb 17, 2015 1:56 pm
Start the script with:

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

thats all i know Smile
avatar
Member [Lv. 0]
Member [Lv. 0]
Posts : 1
Points : 864
Rep : 0
Join date : 2016-03-08
View user profile

Re: Help making script to change from FPS to TPS

on Tue Mar 08, 2016 6:59 am
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.
Member [Lv. 3]
Member [Lv. 3]
Posts : 18
Points : 803
Rep : 1
Join date : 2016-06-09
Age : 14
Location : pakistan
View user profilehttp://www.unityninja.net

Re: Help making script to change from FPS to TPS

on Mon Jun 13, 2016 4:39 pm
hey i'm new in this website
Member [Lv. 3]
Member [Lv. 3]
Posts : 18
Points : 803
Rep : 1
Join date : 2016-06-09
Age : 14
Location : pakistan
View user profilehttp://www.unityninja.net

Re: Help making script to change from FPS to TPS

on Mon Jun 13, 2016 4:40 pm
please help me to make the fps game scripts.........
Back to top
Permissions in this forum:
You cannot reply to topics in this forum