Game Development Community

Problem with the Advance Camera

by Eros Carvalho · in Torque Game Engine · 04/22/2005 (10:49 am) · 1 replies

I am using the Advance Camera of the Thomas "Man of Ice" Lund. But, when the game starts my camera flies until arriving to the player, I would like to know how to make it initiate in the same position of player?

I am making thus:

this code is in GameConnection::createPlayer(%this, %spawnPoint)

%this.advCamera.setPlayerObject(%player);
    %this.advCamera.setThirdPersonMode();
    %this.advCamera.setFollowTerrainMode(false);
    %this.advCamera.setVerticalFreedomMode(false);
    %this.advCamera.setCameraPosition(%spawnPoint);
    %this.setCameraObject(%this.advCamera);


Grateful
Eros

#1
04/22/2005 (1:54 pm)
%spawnPoint is actually a transformation (i.e. it has position and rotation, so it is 7 different values), whereas setCameraPosition takes only a position (only 3 values).

Try instead using this line:
%spawnPos = getWords(%spawnPoint, 0, 2);
   %this.advCamera.setCameraPosition(%spawnPos);

That should probably solve it.