private void Update() { if (isGuiding) // If it is guiding, adjust its position, rotation and scale based on dummy's position { Vector3 newPosition = (DMS.GetSelectedDummy().transform.position - anchorPoint) / positionOffset + anchorPoint; Quaternion newRotation = Quaternion.FromToRotation(Vector3.up, (DMS.GetSelectedDummy().transform.position - anchorPoint)); float newLength = Vector3.Magnitude(DMS.GetSelectedDummy().transform.position - anchorPoint) * lengthOffset; transform.position = newPosition; transform.rotation = newRotation; transform.localScale = V3E.SetY(transform.localScale, newLength); } }