Spine's direction is obtained from aim direction

This commit is contained in:
in0finite 2019-05-23 01:20:40 +02:00
parent cb92bdd3dd
commit 10b5e541bc

View file

@ -121,13 +121,13 @@ namespace SanAndreasUnity.Behaviours.Peds.States
if (ped.CurrentWeapon.HasFlag (GunFlag.AIMWITHARM))
return;
// TODO: spine's forward vector should be the same as aim direction
// this will not work for peds without camera
ped.PlayerModel.Spine.LookAt(ped.Camera.transform.position + ped.Camera.transform.forward * 500);
ped.PlayerModel.Spine.forward = ped.AimDirection;
// now apply offset to spine rotation
// this has to be done because spine is not rotated properly - is it intentionally done, or is it error in model importing ?
// TODO: actually, spine direction should be the same as ped's direction, not aim direction
Vector3 eulers = ped.WeaponHolder.SpineOffset;
if (ped.CurrentWeapon.HasFlag (GunFlag.AIMWITHARM))
eulers.y = 0;