Ccoffee
11-02-2011, 02:45 PM
EDIT This was too easy. Change playercontroller function Rotator GetAdjustedAimFor( Weapon W, vector StartFireLoc ) return value to Pawn.Rotation and the desired behavior presents itself. Move or remove this thread if needed.
I've been working on this particular behavior for quite a while and cannot seem to get it to act right. I've managed to get my character moving in third person with independant directional movement, allowing a player to look in any direction while moving just like many 3rd person games do (right stick camera look like Metal Gear, Resident Evil, Ninja Gaiden, etc.) The problem I am having is that my weapon still fires in the direction the camera is looking, when it really needs to blindfire in the direction that the character is facing at that time. (Currently, you'll just shoot out of your back). Again, a good example of this is like Metal Gear when not aiming or Ninja Gaiden's throwing stars - it always goes in the direction you are pressing / facing.
I'm not here to beg for a cookie cutter solution, or a complete code block. My intention is to discern if there is a standard/simple way to use the rotation of the pawn as aim instead, and let the camera just be a camera? In other words, what player controller or pawn functions are best to override to get the weapon aim from the pawn's rotation?
I've been working on this particular behavior for quite a while and cannot seem to get it to act right. I've managed to get my character moving in third person with independant directional movement, allowing a player to look in any direction while moving just like many 3rd person games do (right stick camera look like Metal Gear, Resident Evil, Ninja Gaiden, etc.) The problem I am having is that my weapon still fires in the direction the camera is looking, when it really needs to blindfire in the direction that the character is facing at that time. (Currently, you'll just shoot out of your back). Again, a good example of this is like Metal Gear when not aiming or Ninja Gaiden's throwing stars - it always goes in the direction you are pressing / facing.
I'm not here to beg for a cookie cutter solution, or a complete code block. My intention is to discern if there is a standard/simple way to use the rotation of the pawn as aim instead, and let the camera just be a camera? In other words, what player controller or pawn functions are best to override to get the weapon aim from the pawn's rotation?