Game Development Community

Switching to first person

by Robert Allen · in Technical Issues · 01/24/2007 (8:46 am) · 1 replies

Hi All,

I am working on a game at the moment and I need to implement a certain piece of functionality and am not sure how to do it.
I am currently using the 3rd person camera from the programming forums, Advanced Camera tutorial. I start in 3RD person , but I want to only be able to shoot when I am in first person. So I want the player to hold down a key to keep them in first person, and in first person limit the player movement. So you cannot use the crossbow as a fast attack weapon.
Anyone have any pointers where I should do this.
In revew

Hold a key to use crossbow in first person.
Limit player movement in first person.

Any help would be grealty appreciated,

Rob

#1
02/14/2007 (1:18 pm)
To get the first person zoom view I use:
function Aim(%val)
{
if($cameraFOV == 120)
{
$mvTriggerCount1++;
setFOV( 45 );
$firstPerson = true;
ServerConnection.setFirstPerson( $firstPerson );
}
else if($cameraFOV != 120)
{
$mvTriggerCount1++;
setFOV( 120 );
$firstPerson = false;
ServerConnection.setFirstPerson( $firstPerson );
}
}
For firing you could use an if statement about if $FirstPerson = true etc.