Game Development Community

Mount a sprite TO the Camera

by CharlesL · in Torque Game Builder · 10/08/2012 (5:04 pm) · 5 replies

I know it's possible to mount the camera to an object, but is there a way to mount an object to the camera? Here's my current code:
function touchDetector::onLevelLoaded(%this)
{
	%force = 20;
	sceneWindow2d.mount(player, "0 0", %force, true);
	touchDetector.mount(sceneWindow2d, "0 0", 0, true);
}

I don't know why it wouldn't work.

#1
10/09/2012 (4:09 am)
@CharleslL - Forgive me, but I don't really see the point of mounting an object to the camera. If the camera moves, then you want the object to move? Isn't that the same as saying if the object moves, the camera will move? Maybe an example would be helpful.
#2
10/09/2012 (4:45 am)
:) Yes, I thought the same first, but then I didn't sleep well.
Or perhaps he has multiple objects he wants to mount in a specific order, I don't know too. More explanation is needed.

#3
10/09/2012 (6:35 am)
@Michael Perry I want to mount an object that can detect touch to the camera, but the camera will move. Like a GUI.
#4
01/15/2013 (4:23 pm)
I'm trying this as well, to have the background stay with the camera.
I have the camera mounted to the player, and I want my "sky" image on the backmost layer to follow the camera around the level as the player moves.
#5
01/15/2013 (4:53 pm)
Mount the sky to the player as well....