Game Development Community

Advanced Camera getCameraPosition returns 0's?

by Terence Tan · in Torque Game Engine · 04/19/2006 (2:26 am) · 2 replies

I implement Thomas Lund advanced camera and I am trying to spawn an AI on the current camera position.

I tried this on the console LocalClientConnection.advcamera.getPosition() and got 0,0,0 ...? I am putting the camera in Orbit mode if that makes a difference?

Im also trying to change way the player controls the avatar. Instead of the standard WASD FPS controls. I want to stick the camera in over head 3rd person and use WASD to move the player up/down/left/right accordingly. Is that possible in script. I understand the client allow specification of unit vectors in movement. Would I have to calculate the specific unit vectors depending on the characters facing? (i.e. if the character is facing right...hitting W would make the character move right). I am fine with typing the mouse to rotate the camera as it is by default.

#1
04/19/2006 (6:26 am)
It's more or less a bug. The advanced camera does nothing on the server, so it never updates it's server position. That causes problems with scoping, since objects may disappear once you get too far from "0 0 0".

A quick fix is make it reposition itself to it's playerObject position during the processTick, on the server.
#2
04/19/2006 (8:06 am)
Yep,

That was it. Found your resource update a little bit further down. Thanks for taking the time to help me.