So, I have a model, where the gun is animated and shooting…
I have the character face the mouse position, but when I apply an offset of 45º, now the gun is aiming at the correct/desired location… However, now the models “front” is 45º off.
My Movement Script is:
CharacterController controller = GetComponent<CharacterController>();
if (controller.isGrounded)
{
moveDirection = new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical"));
print(moveDirection);
moveDirection = transform.TransformDirection(moveDirection) ;
moveDirection *= Speed;
if (Input.GetButton("Jump"))
moveDirection.y = jumpSpeed;
}
moveDirection.y -= Gravity * Time.deltaTime;
controller.Move(moveDirection * Time.deltaTime);
is there a way to fix this? Via the code?