Engage 3rd person camera view via script at start
by Ben Mathis · in Torque Game Engine · 06/07/2007 (3:47 pm) · 2 replies
Just as the title says. How do I ensure that the third person camera view is engaged using scripts, as soon as the mission starts?
I tried a search and looked through the code, but have come up blank.
More specifically, what is the script equivalent of pressing "tab" to switch to 3rd person, and then where would the resulting line of code go to make sure it's loaded first thing when any mission starts.
I tried a search and looked through the code, but have come up blank.
More specifically, what is the script equivalent of pressing "tab" to switch to 3rd person, and then where would the resulting line of code go to make sure it's loaded first thing when any mission starts.
Torque Owner Andy Rollins
ZDay Game
in common/server/clientConnection.cs:
function GameConnection::onConnect( %client, %name ) { ... ServerConnection.setFirstPerson(false); // added at the end }or in starter.fps/server/scripts/game.cs:
function GameConnection::createPlayer(%this, %spawnPoint) { ... %this.setFirstPerson(false); }Both work but perhaps someone more experienced can comment if there is a right place to put it and hopefully an explanation as to why.
As a side note you should make sure a couple of parameters in the data block are set correctly otherwise you won't get into 3rd person view, the correct setting should be:
datablock FlyingVehicleData( myFlyingVehicle ) { ... firstPersonOnly = false; observeThroughObject = true; };firstPersonOnly - Render shape when in first person (only applies to shapes that
are observed through.
observeThroughObject - If true, camera will use this shape's camera parameters, when
this is the controlled object
If you want to disable 1st person view completely then just remove the actionmap or delete the code from toggleFirstperson function.
Hope that helps.