Game Development Community

Jumping Camera from Path to Path

by Night Fox · in Torque Game Engine · 02/05/2009 (7:10 am) · 2 replies

Currently i've got my camera circling about on a path.

I've two paths created with the plan of having the main camera jump from one camera to another on the click of a GUI button.

So far this is a two part answer I'm looking for.

1. How to get a camera to load from one path to another.
2. How to get a Gui to control the camera.

I already went through the Demo folder and all its scripts, I even wen theough the GUI editor, but it seems that the new TGE Demo is more embedded than I hoped making it hard to disect both the gui and the code.

I already pulled searches online and I've mainly found the same questions being asked with a lack of answers.

I'm am artist that needs a "Tom Tom" like instruction in helping me set this up.

[code]
// Create path camera
%this.PathCamera = new PathCamera() {
dataBlock = LoopingCam;
position = "0 0 300 1 0 0 0";
};

%this.PathCamera.followPath("MissionGroup/CameraPath");
MissionCleanup.add( %this.PathCamera);
%this.PathCamera.scopeToClient(%this);




// our second path camera
%this.PathCamera2 = new PathCamera() {
dataBlock = LoopingCam;
position = "0 0 300 1 0 0 0";
};

%this.PathCamera2.followPath("MissionGroup/CameraPath2");
MissionCleanup.add( %this.PathCamera2);
%this.PathCamera2.scopeToClient(%this);

$Server::Client = %this;
%this.setControlObject(%this.PathCamera2);
[code]

#1
02/05/2009 (9:55 am)
Alright just a heads up I think I have somewhat of an idea on bouncing the camera.

So looking at the code I see this particular bit

%this.setControlObject(%this.PathCamera);

so i decided to set a global if statement using $Cam = 1 as my Global. If the cam equals 2 then it should bounce to another path (CamPath 2). Now how would I make it so that the Gui button I have adds + 1 to $Cam? I'm not quite used to Gui's to be honest (In TGB I used more behaviors to work around then GUI's) so I'm going to need some good directions on this!
#2
02/06/2009 (8:14 am)
Hmm nother problem I've snagged is I've got the level loading as it should, but it doesn't switch to the camera on rails, (working from the tutorial.base here) so i'm trying to figure why the camera isn't starting off in the path. When I reload the level via the editor it works.