Game Development Community

Angle camera to always point at player.

by Anthony Merlo · in Torque 3D Professional · 04/04/2011 (2:01 pm) · 1 replies

Working in script I was able to change the camera view to where I want. Sort of and extended 3rd person or GOD like view mode. The problem is that the camera only points on a flat plane and I want it to point down at the player. That way if I alter the camera hight or distance I will still be able to view the player.

My goal is to eventually have the player controlling the camera and the character turning to follow the camera's rotation. Sort of like 3rd person view in Worlds of Warcraft.

Here is the code I'm using:

LocalClientConnection.camera.setOrbitObject(LocalClientConnection.player, "0 0 0", "0", "0", "0", false, "0 -20 4", false);

I tried changing the rotation (second argument) but it doesn't seem to do anything.

Any help would be appreciated.

Thanks!

#1
04/05/2011 (11:19 am)
Ok, I figured out why my angle wasn't working and fixed that (www.garagegames.com/community/forums/viewthread/112553). I also have it so the mouse wheel will zoom in and out. The only problem I'm having now is figuring out how to make the camera rotate around the character. It seems to only want to point in one direction. North, for instance. You can move the character around but the camera will only watch the player from one direction.

Is there a way to make the camera orbit around the player from any other angle?

Thanks