Skip to content

Instantly share code, notes, and snippets.

@xcombelle
Created May 28, 2023 09:44
Show Gist options
  • Save xcombelle/82dffb828d3216c0dca1fcf1600eb26f to your computer and use it in GitHub Desktop.
Save xcombelle/82dffb828d3216c0dca1fcf1600eb26f to your computer and use it in GitHub Desktop.
// Define the two rotations as quaternions
Quaternion rotation1 = Quaternion.Euler(x1, y1, z1); // First rotation
Quaternion rotation2 = Quaternion.Euler(x2, y2, z2); // Second rotation
// Combine the rotations
Quaternion combinedRotation = rotation1 * rotation2;
// Apply the combined rotation to the object's transform
transform.rotation = combinedRotation;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment