kadyr

Untitled

Nov 30th, 2021
885
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public void UpdateTransform (Vector3 newPosition, Quaternion newRotation)
  2.     {
  3.         transform.position = newPosition;
  4.         transform.rotation = newRotation;
  5.  
  6.         if (referenceGrouper != null)
  7.         {
  8.             Vector3 posDiff = transform.position - _originPos;
  9.             Quaternion rotDiff = transform.rotation * Quaternion.Inverse(_originRot);
  10.  
  11.             referenceGrouper.position = transform.TransformPoint(_grouperPosLocal);
  12.             referenceGrouper.rotation = transform.rotation * _grouperRotDiff;
  13.             referenceGrouper.localScale = _grouperOriginScale * _playScaler;
  14.         }
  15.     }
RAW Paste Data