Game Development Community

Rotating the camera with the weapon

by Emerson Gresoski · in Torque Game Engine · 12/17/2006 (9:39 am) · 2 replies

How I rotate my camera and weapon with the mouse? Like a Tank, but, the rotation of this weapon and the camera can't rotate the tank.

#1
12/17/2006 (1:39 pm)
I'd look at the turret resource:
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=4116

It provides the same functionality, but with a stand-alone turret. One reasonably simple way to do it would be to mount one of these turrets on top of your tank, then mount the player in the turret.

Controlling both the movement of the tank (with keys or something) at the same time is a bit trickier. I think you have to hack into the MoveManager to do that....(searching)...well, I spoke too soon. There's already a resource to do that, too:
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=9075

(which I'm now going to look into myself, since I need it).
#2
12/18/2006 (4:53 pm)
If you're refering to doing this on a player model, think there's an easy hack... Just mount the head node to the waist of your model. When you activate "freelook", your mouse controls the rotation of the head node and not the rotation of the entire model.

If you're looking to do this on a vehicle or other non-player object, I'd recommend plunking down the cash for the Tank Pack from Bravetree. It's a one-stop for all your turret needs. :)