Skip to content

Commit

Permalink
#733 Improved calculation of the laser direction.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yvo02 committed Aug 2, 2024
1 parent 838b82b commit e56ac5e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Assets/SEE/Game/Avatars/VRAvatarAimingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,8 @@ private void Awake()
Laser.On = true;
if (HandBone == null)
{
HandBone = gameObject.transform.Find(
"CC_Base_BoneRoot/CC_Base_Hip/CC_Base_Waist/CC_Base_Spine01/CC_Base_Spine02/CC_Base_R_Clavicle/CC_Base_R_Upperarm/CC_Base_R_Forearm/CC_Base_R_Hand")?.transform;
//HandBone = gameObject.transform.Find("Root/Global/Position/Hips/LowerBack/Spine/Spine1/RightShoulder/RightArm/RightForeArm/RightHand")?.transform;
HandBone = gameObject.transform.Find("CC_Base_BoneRoot/CC_Base_Hip/CC_Base_Waist/CC_Base_Spine01/CC_Base_Spine02/CC_Base_R_Clavicle/CC_Base_R_Upperarm/CC_Base_R_Forearm/CC_Base_R_Hand")?.transform;
}
if (HandBone == null)
{
Expand All @@ -91,7 +90,7 @@ private void Update()
// The direction of the HandBone needs to be adjusted.
// The direction is not just in forward direction
// of the axis from palm to fingers.
Vector3 direction = HandBone.rotation * Vector3.left;
Vector3 direction = HandBone.rotation * Vector3.up;
// Move the aim target to the tip of the laser beam.
Target.position = Laser.PointTowards(direction);
}
Expand Down

0 comments on commit e56ac5e

Please sign in to comment.