Camera mount script help
by Freb Frebson · in Torque Game Builder · 11/19/2006 (5:15 am) · 3 replies
I need help with tracking a sprite with the camera i realy suck at scripting any help would be great i have been using the fish game as a test here is my rather poor attempt
FishPlayer.mountCamera = true;
mount(%object, %offsetX, %offsetY, %mountForce, %sendToMount)
%object.fishimagesImage
%offsetX,(452.11);
%offsetY,(150.551);
%force,1
%sendToMount(True);
FishPlayer.mountCamera = true;
mount(%object, %offsetX, %offsetY, %mountForce, %sendToMount)
%object.fishimagesImage
%offsetX,(452.11);
%offsetY,(150.551);
%force,1
%sendToMount(True);
#2
Open game.cs, look for the following function, and add the line in bold
Good luck, John.
11/30/2006 (6:49 pm)
Im a newbie, so I will just comment on another way to mount camera to your fish:Open game.cs, look for the following function, and add the line in bold
function startGame(%level)
{
// ... code ...
[b]// put this at end of startGame()
sceneWindow2D.mount($FishPlayer);[/b]
}Good luck, John.
#3
Hope this helps,
Simon
P.S The link may not work if you've not bought TGB, you can access the page by going through the documentation.
12/12/2006 (12:40 pm)
I know this is slightly of subject but I'd highly recommend the tdn.garagegames.com/wiki/TGB/MiniPlatformerTutorial, this has a whole section on getting the camera to follow the player around, plus loads of other useful help.Hope this helps,
Simon
P.S The link may not work if you've not bought TGB, you can access the page by going through the documentation.
Simon Barnes
I'm no expert having only recently come across TGB and having only registered within the last five minutes. However I think you might want to revisit the line which reads:
%force,1
maybe it should read...
%mountForce,1