Problem changing to new camera path
by Rubes · in Torque Game Engine · 09/29/2006 (8:52 am) · 1 replies
Hey everyone...
I'm trying to implement an opening screen for my game, where the camera follows a fly-by path around the mission level while the main menu is displayed. Once the player selects "Start Game", I would like the camera to switch to a new fly-by path for a quick introductory sequence. So I went ahead and created two separate paths in the mission. The first path contains 17 pathMarkers, while the second path has only 5 pathMarkers.
When the game loads, the camera is set to the first path appropriately using the %client.PathCamera.followPath() method. Works nicely. When the player selects "Start Game", I set the pathCamera to follow the new path using the same followPath() command.
Instead of switching to the second path, however, the camera moves to a different point further along the first path.
If I do the followPath() command manually from the console, the same thing happens. If I do it again, it again moves to a point further along the first path. I have to call followPath() four times before it finally gets on the second path, and then it does what it's supposed to do, circling around only the second path.
The two paths are completely separate in the mission file, so I can't imagine why this is happening. Even if I try deleting the first path before switching to the second path, it still advances along the first path when I call followPath().
Any thoughts?
I'm trying to implement an opening screen for my game, where the camera follows a fly-by path around the mission level while the main menu is displayed. Once the player selects "Start Game", I would like the camera to switch to a new fly-by path for a quick introductory sequence. So I went ahead and created two separate paths in the mission. The first path contains 17 pathMarkers, while the second path has only 5 pathMarkers.
When the game loads, the camera is set to the first path appropriately using the %client.PathCamera.followPath() method. Works nicely. When the player selects "Start Game", I set the pathCamera to follow the new path using the same followPath() command.
Instead of switching to the second path, however, the camera moves to a different point further along the first path.
If I do the followPath() command manually from the console, the same thing happens. If I do it again, it again moves to a point further along the first path. I have to call followPath() four times before it finally gets on the second path, and then it does what it's supposed to do, circling around only the second path.
The two paths are completely separate in the mission file, so I can't imagine why this is happening. Even if I try deleting the first path before switching to the second path, it still advances along the first path when I call followPath().
Any thoughts?
Torque 3D Owner Rubes
I had thought that the call to followPath() cleared the old path, but it looks like it just pushes the nodes on the path of interest into the queue. A quick call to %client.pathCamera.reset() before the call to followPath() does the trick.