Dynamic camera
by Andy S. · in Torque X 2D · 03/23/2009 (11:31 am) · 3 replies
Hi,
in my game I have two players, both animated sprites. The level is much bigger than the camera, so I want that the camera moves around with the players. If the two players go away from each other, I want the camera to zoom out, if they come close to each other, I want it to zoom in. Never should one of the two players not be visible by the camera.
I thought of having a blank scene object, and then mounting the camera to it. Still I don't know how to manage this behaviour I want with the zooming camera...I would appreciate any help on this.
Thanks,
andi
in my game I have two players, both animated sprites. The level is much bigger than the camera, so I want that the camera moves around with the players. If the two players go away from each other, I want the camera to zoom out, if they come close to each other, I want it to zoom in. Never should one of the two players not be visible by the camera.
I thought of having a blank scene object, and then mounting the camera to it. Still I don't know how to manage this behaviour I want with the zooming camera...I would appreciate any help on this.
Thanks,
andi
Torque Owner Sean Monahan
I haven't done any camera zooming but you could easily add this by calculating the distance between the two players and then using this value to determine how far in or out the camera should be zoomed.