Game Development Community

Camera Mount Problem

by Johannes Pauw · in Torque Game Builder · 02/07/2006 (10:07 am) · 3 replies

To put it simply -- Camera mounting doesn't seem to be working for me. I'm creating a top-down spaceship game where I want the camera to track the player with a slight delay. The code I'm using is:

SceneWindow2D.mount($player, "0 0", 1, true);

It's in my createPlayer(); function, after the player has been totally defined and created. When I run Torque, the camera just sits there, even if the ship moves.

I really have no idea at all what's going wrong.

#1
02/07/2006 (10:47 am)
Pasting this code:

$player = new t2dStaticSprite() { scenegraph = t2dScene; imageMap = ggLogoImageMap; linearVelocity = "10 0"; };
   sceneWindow2D.mount($player, "0 0", 1, true);

at the end of setupT2DScene in T2D/gameScripts/game.cs seems to work just fine. What version of T2D are you using? I tested this on Beta 1.

Could you post some more of your scripts and the console.log file. That would better help me track down the problem.
#2
02/07/2006 (10:58 am)
The deprecated version, apparently. I'm d/ling the new release right now. Thanks for pointing that out!
#3
02/07/2006 (7:52 pm)
With the new version it worked like a charm. Thanks again!