Game Development Community

Player's ear position not updating

by Lunacy · in Torque 3D Professional · 05/14/2011 (7:39 pm) · 4 replies

Hi, so I'm trying to set up a specific type of camera that I need (side-scroller like) so I use something like :

%client.setCameraObject(%client.camera); 
%client.camera.setOrbitObject(%client.player, mdegtorad(30) @ " 0 0", 5, 15, 5, false, "0 2 1", true);  
%client.setFirstPerson(false);

(taken from here)

It works just as expected, however it seems like the "ear" of the player (the position in space where sounds are received, in other words the camera, from what I can understand) does not move at all and gets stuck to its initial position. Should I add something else to the code? How are sounds handled regarding the player's position? Thanks for help.

Edit : calling camera.getPosition() always returns the same value, even though the camera follows the player. Calling setOrbitObject() brings the camera to the player, but then the camera won't actually move (getPosition()) until we call setOrbitObject() again, but still follows the player.

#1
05/15/2011 (10:11 am)
Your doing it wrong ... somehow. %client.camera.getPosition() updates fine in my tacticsTutorial.

Maybe something to do with your controlObject? Wildly guessing now.
#2
05/15/2011 (10:23 am)
Thanks for your answer. Haven't finished your tutorial yet =x I'm going to complete it now, and have a look at how cameras are handled. But my guess is that since you do not control the player directly, but rather the camera, you won't have any problems with that. You controlObject and your cameraObject are the same I think, so everything gets updated well. In my case, the controlObject is the player, and the cameraObject is the camera, which seems natural to me. I'll still have a look at your tutorial to be sure I'm not mistaken.
#3
05/15/2011 (10:55 am)
Wouldn't using the "cam" node (3rd person) be more what you want?
#4
05/15/2011 (11:05 am)
Definitely, however I don't seem to get it working as I expect it to work; it doesn't seem to be as simple as placing a node somewhere in space. I need the camera to point at the player from the side, however rotating the existing "cam" node for gideon doesn't change anything. I feel like it's built to face the same direction as the player.. I may be missing something important.

EDIT: Manoel Neto posted a fix there some time ago that solves the problem, so many thanks to him. I still don't know if this should be considered as a bug or not but, well, problem solved.