Game Development Community

Updating Clientside only player variables

by Adam Beaumont · in Torque Game Engine · 12/03/2003 (5:50 am) · 1 replies

I've been trying to set something up where u can press a button and your view switches from front to rear facing. Release the button and your view goes back to forward facing.

I've done this following the way that FOV and third person are implemented - hook a console variable into game connection and then make use of it when asking the player object for its controlcameratransform.

This works ok but i think that the variable isn't really in the right place - I have it on gameconnection and it feels like it should be on the player object itself. For instance if the player has rear firing missiles (or something) then the player object would need to know which view is being used.

So I'd like some advice on whats the best way for me to get a variable set from a bind in script to the player object on that client?

Should I use ServerConnection.getControlObject() directly or is there a 'better' way to do it ? Any direction would be appreciated...

#1
12/03/2003 (7:27 am)
That might just be in the right place. However, I think you would put it on the highest class that a camera can mount onto, which I think is GameBase, or possibly SceneObject. If you do this, then you can use the same sceme for vehicles and such without duplicating any code.