Follow camera - how?
by Markus Wahlgren · in Torque Game Builder · 07/31/2006 (10:48 pm) · 4 replies
Hi!
I admit, I'm a n00b in need of basic help.
In the TDN FAQ there is an answer that goes like: "remember you can mount the camera to the player".
-That is exactly what I want to do, but I can't find out how to. Think Zelda 3, the camera follows Link wherever he goes.
This is generally speaking, not for a specific game. You can use the shooter/scroller tutorial (with the ship's world limits removed) as code example if you want.
Can you help me?
I admit, I'm a n00b in need of basic help.
In the TDN FAQ there is an answer that goes like: "remember you can mount the camera to the player".
-That is exactly what I want to do, but I can't find out how to. Think Zelda 3, the camera follows Link wherever he goes.
This is generally speaking, not for a specific game. You can use the shooter/scroller tutorial (with the ship's world limits removed) as code example if you want.
Can you help me?
#2
08/02/2006 (11:25 pm)
Thanks! I'll check that out for sure, but I also saw that that tutorial uses a bit of old code that won't work in the new version of TGB, so I guess I'll ask again when/if it doesn't work.
#3
Replace "t2dSceneWindow" with the name of your scenewindow. The default is sceneWindow2D (I think). Next look in the TGB reference doc for a description of all the parameters, and set them accordingly.
08/03/2006 (6:56 am)
Basically adjust and add this code to one of your .cs's that get executed:t2dSceneWindow.mount(%object, %offsetX, %offsetY, %mountForce, %sendToMount)
Replace "t2dSceneWindow" with the name of your scenewindow. The default is sceneWindow2D (I think). Next look in the TGB reference doc for a description of all the parameters, and set them accordingly.
#4
08/03/2006 (7:46 am)
Yup, Kevin's method is probably what your looking for. To keep the camera rigid, you would want the mount force to be 0. And, yes, the default name for the t2dSceneWindow is "sceneWindow2D".
Associate Tom Spilman
Sickhead Games