Game Development Community

Camera Questions

by Clark Kromenaker · in Torque Game Engine · 11/06/2005 (7:56 am) · 1 replies

Hi everyone,

I'm attempting to break away from the First Person Shooter genre just because there are so many. I don't know how many of you have played Gabriel Knight 3 by Sierra, but I'm aiming to set up a system similar to that.

*User controls the camera object and clicks to move the player character. The camera initially can only move forward and backward and pan left and right. In order to look up or down the user must also hold down the shift key. To strafe, the player must hold down the ctrl key.

PROBLEM 1:

I made the camera the control object and tweaked the controls to give the above functionality. However, it goes through terrain and buildings. How might I give the camera object collision detection?

PROBLEM 2:

When the camera is pointed toward the sky or toward the ground (after moving it with SHIFT), pressing just the forward arrow should have the effect of still just moving forward (sort of like if you look up or down and walk straight ahead). What it really does, though is move in the direction I'm facing. So, like, I'll move toward the ground or toward the sky. I guess I'm wondering how to keep the z-axis level constant when they don't have the CTRL key pushed down.


Any help in understanding this is most appreciated.

#1
11/09/2005 (11:04 am)
With Problem 1, take a look at the implementation for the Advanced Camera Resource. It's not perfect, but it basically "zooms" the camera in towards the player until there are no intervening objects to block the view.