Game Development Community

Stupid Newb Camera Question - 3rd person view

by Russ Spears · in Torque 3D Professional · 01/12/2010 (9:39 pm) · 2 replies

How do I start in 3rd person view (without hitting "Tab") in T3D 1.0.1? I know I've got to have skipped over this somewhere, but I've been scanning docs and searching threads and can't find it.

#1
01/13/2010 (6:27 am)
function toggleFirstPerson(%val)
{
   if (%val)
   {
      ServerConnection.setFirstPerson(!ServerConnection.isFirstPerson());
   }
}

This is what actually gets called when you press Tab. Assuming the player starts in first person, you could just call this function as soon as the client load is finished, or you can specifically use the function call there to set first person to false.

Calling:
ServerConnection.setFirstPerson(false);
on the client will always set third person, instead of relying on a toggle.

GameConnection::initialControlSet in scripts/client/serverConnection.cs looks like a good place to fire this. As the comment in that function says, "The first control object has been set by the server and we are now ready to go."
#2
01/13/2010 (9:15 am)
@Henry, thanks - especially for scripts/client/serverConnection.cs - time to start breaking things and learning how they work!