Author Topic: Cameras in Game-Mode  (Read 2307 times)

I am trying to make a script that, when a player spawns, their camera is placed like the Rampage Game-Mode for 6 seconds, then it it moved to another angle. After this, the player character is spawned. Any ideas?

Camera position is defined in the datablock. You'll have to make two different datablocks and change them 6 seconds after spawn.

Oh, I misunderstood his question.
« Last Edit: September 03, 2012, 10:58:17 PM by TripNick »

Camera position is defined in the datablock. You'll have to make two different datablocks and change them 6 seconds after spawn.
No, just use %camera.setTransform(%transform).

Here's an example from the Rampage gamemode:
Code: [Select]
// get the position
%pos = "-44.5949 -89.0925 21.4696 0.25952 -0.10295 0.960235 0.783533";

// set their camera to the position
%client.camera.setTransform( %pos );

// remote control our player from the camera
%client.setControlObject( %client.camera );
%client.camera.setControlObject( %client.player );

// right now we don't want the user to see his player, so let's set their transform somewhere far off
// we do this to keep the camera frozen, probably a better way to do this
%client.player.setTransform( "0 0 -20" );
%client.player.setScale( "1 1 1" );
There are actually better ways to do the last part, but that works well enough and it's what they used in the Rampage mode.

Any way of getting the orbs position via the console?

I would think %camera.getTransform();, what else would it be?

findClientByName("Jeep").camera.getTransform();

Setting the camera doesn't seem to be working. Nothing happens when the event is called, but I do get these warnings:

Unable to find object: '' attempting to call function 'setTransform'
Unable to find object: '' attempting to call function 'setControlObject'

Is %client defined...?

Post your code.

Is %client defined...?

Post your code.
%client is defined. It is initiated on:

GameConnection::onClientEnterGame(%client)

Everything else under the onClientEnterGame works fine that calls %client

Make sure that you do that stuff after the parent.

Oh, I misunderstood his question. I thought he meant the third person camera was at a different angle and he wanted it to be changed to normal after 6 seconds.
their camera is placed like the Rampage Game-Mode for 6 seconds, then it it moved to another angle
"angle" is what threw me off

If you want the transition to be smooth, research pathCameras.

That's what I used in this.

Any ideas how to return the player to their blockhead after?

Any ideas how to return the player to their blockhead after?
I think it's %client.setControlObject(%client.player);