Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question Looking for a Unity.Mathematics version of Quaternion.FromToRotation

Discussion in 'Scripting' started by bsgbryan, Jul 13, 2020.

  1. bsgbryan

    bsgbryan

    Joined:
    Nov 27, 2015
    Posts:
    26
    I'm building a game using DOTS and am working on adding support to a first-person controller to allow the player to walk around a sphere.

    My understanding is that I could use Quaternion.FromToRotation in the non-DOTS world to rotate my player character so they stay properly aligned to the sphere as they walk around. I haven't been able to find anything equivalent in Unity.Mathematics. Does anyone know if it exists?

    I found this - which looks helpful; worst case, I can attempt to transcribe MyQuaternion.FromToRotation to a Unity.mathematics.quaternion equivalent. I'm no quaternion expert, though, so I'd prefer to avoid this, if possible.

    Can anyone point me in the direction of any helpful resources? Ultimately, I want to understand quaternions in-depth, so resources for that would be much appreciated too!

    Thanks!
     
  2. bsgbryan

    bsgbryan

    Joined:
    Nov 27, 2015
    Posts:
    26
    I'm not sure how to delete this thread. I discovered Unity Answers and thought that was a more appropriate place for this than here. Please see that question.