Game Development Community

Auto center aiming?

by Jonathan Kelly · in Torque Game Engine · 01/18/2005 (11:40 am) · 3 replies

Sorry for all the questions, I got the weapons changing just fine.

I'm wondering about having the aim auto center so that its level whenever I change weapons (this is working with our melee system which is just an invisible short range gun pointing downwards :) ). Nothing I've found looking through resources.

Anyone encountered this aswell?

#1
01/18/2005 (12:12 pm)
You can set your player's move pitch to 0 in player.cc, Player::UpdateMove.

Replace:
F32 p = move->pitch;
      if (p > M_PI) p -= M_2PI;
with
F32 p = 0;

Here's a couple melee resource:
Hand to Hand Combat, Locational Damage and Collision and More
Server Side Melee System
#2
01/18/2005 (12:19 pm)
Well, that locks the player from using pitch completely. :(

Is there a way to get global acess to 'p' and set it in script?
#3
01/18/2005 (12:28 pm)
Like this?
F32 p;
      if (mMelee)
      {
         p = 0;
      }
      else
      {
         p = move->pitch;
         if (p > M_PI) p -= M_2PI;
      }

You can make a console method to turn it on/off.