Game Development Community

Free camera

by Nancy Lee · in Technical Issues · 10/10/2008 (9:14 pm) · 2 replies

Hi, is there anyway that when I start the game, my camera is in free mode.

do u know where I should make changes?

Thanks a lot!

#1
10/11/2008 (12:00 am)
Ok, I'm assuming that you are using either starter.fps (TGE) or stronghold(TGEa). In T3d (TGEa) it's even easier. And slightly different in tutorial.base, but almost the same regardless of project.

Open up game.cs and look for the function GameConnection::onClientEnterGame(%this). Inside of there you will see where it sets up a new Observer camera, zero's the score, and then calls the function that creates the player %this.spawnPlayer(). Comment out that line. That will prevent the player from being spawned with a armor/player datablock.

Now you need to give the player control of the camera. Still inside GameConnection::onClientEnterGame(%this), at the end, add these three lines
%this.setControlObject(%this.camera);
%spawnPoint = pickSpawnPoint();
%this.camera.setTransform(%spawnPoint);

And that should be it.
edit: 3 AM spelling ;)
#2
10/11/2008 (4:15 am)
Haha got it working!!! thanks so much Mike!!