Not sure if I understood correctly what is your problem, but having traveled this road I thinl I can provide you with some ideas:
- Coordinates X and Y are easily transformed into your AimDirection and AimHeight. However, you also need another axis to identify how far is the aimed target from the camera in order to specify a point in your scene. If there is any object at the end of your aiming line, everything is cool. If, in the other hand, there is the possibility that your aiming line does not intersect any object at a certain time, most routines are useless. To solve this you need to create a dummy target and position it at a certain distance from your aiming start. Make an FSM to move this target using the values you've got from the Mouse position. This insures you'll always have an object at the end of the raycast. Don't forget to parent this dummy target to your character so its position remains constant regardless of on which direction you move.
- The human player is aiming at the target looking through the camera which has an offset position from the character playing the aiming animation. Hence, you need to provide your character with a LookAt object which evidently is different from the position (Vector3) and rotation (Quaternion) used by the camera. If you are aiming from your character, a parallelax error will be noted whereas if you are aiming from the camera it will not. The bullet, however, and assuming you are using a firearm will come from your weapon model as the start of its own aiming line and will extend to the postion of your dummy target.
- The distance at which you are going to position your dummy target depends on your game, because the Mouse position plus the target distance will provide you with an angle. If the real target is too close or too far away, you may miss it because the angle between your real target and your dummy target are too different.
Once you have solved this, your have:
- An origin position and rotation
- A destination position and rotation
- An angle between the origin and the destination
Normalize the angle so the max negative and max positive for the VerticalAim and HorizontalAim are between -1 and +1, and feed this values to your animator FSM, which then could use them to play the correct animation.
Get Axis is for reading your input speed and direction (what makes your character move). When you press any movement key or stick, Get Axis gets its normalized value and hence you can't use them for aiming... If you are controlling something like a turret, you need to feed the Get Axis Horizontal and Get Axis Vertical into other variables which ADD or SUBTRACT some specific value to move your weapon in the intended direction.