Created
May 28, 2023 09:44
-
-
Save xcombelle/82dffb828d3216c0dca1fcf1600eb26f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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