rotate vector3 around pivot point unity code example
Example 1: rotate vector3 around pivot point unity
public Vector3 RotatePointAroundPivot(Vector3 point, Vector3 pivot, Vector3 angles) { return Quaternion.Euler(angles) * (point - pivot) + pivot; }
Example 2: unity rotate around point
transform.RotateAround(point, axis, degrees);