Understand Unity Rotation in 5 minutes

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 ม.ค. 2025

ความคิดเห็น • 41

  • @Banaaani
    @Banaaani ปีที่แล้ว +36

    I am an ICT-engineer that specialized in game development. Even my Unity teacher said: if you need to work with quaternions, the best thing to do is go to a corner and cry.

  • @rustygear447
    @rustygear447 ปีที่แล้ว +8

    Great video. This is also how I deal with quaternion. Don't need to understand the math. Just know the useful functions.

  • @fkeyzuwu
    @fkeyzuwu ปีที่แล้ว +2

    just learned about rotation types today and this popped in my recommended videos, super consice and helpful. although i think there might be some suboptimal solutions here but i understand the ideas overall.

  • @trunghieu974
    @trunghieu974 ปีที่แล้ว +7

    My biggest mistake while learning Unity was trying to understand quaternion DEEPLY 🤣🤣🤣🤣🤣🤣

  • @photonic083
    @photonic083 7 หลายเดือนก่อน +2

    those chatgpt generated inspirational quotes were hilarious

  • @smallwood369
    @smallwood369 ปีที่แล้ว +2

    Thanks, I learned a lot, specially on the `Quaternion.FromToRotation`.

  • @Napriiihm
    @Napriiihm 7 หลายเดือนก่อน

    You make me laught with you serious voice with "quaternioon" at 0:12, that was the world I was Struggling with :D Thank you :)

  • @StupidJellyfish
    @StupidJellyfish 9 หลายเดือนก่อน

    This was a fantastic tutorial. Thank you!

  • @Zucth
    @Zucth 9 หลายเดือนก่อน

    4 months ago I ask my senior, "What is Quaternion stand for? How do I use or understand these stuff" he said you better not, just ask for the result.
    .
    Today I just found this video, I'm not regret, it just a bit overwhelm. And yea my head is dead. 😂

  • @angeldude101
    @angeldude101 ปีที่แล้ว +3

    If you're finding a Quaternion by getting an angle between two vectors with atan, you're probably better off using the function that takes two vectors and gives the Quaternion between them. The latter is really √(u/v) (literally, undoing v, then doing u, then halving the distance travelled because otherwise they act like reflections), which could require a normalization step, but doesn't require using atan and then immediately sine/cosine.
    If you're doing 2D games, then you really don't need Quaternions. Complex numbers work just fine as long as you don't treat them like 2D directions.
    Quaternions aren't inherently hard to understand. They're hard to understand because they're obfuscated.

    • @UnityForge
      @UnityForge  ปีที่แล้ว

      Thank you for your input. As I said in most of examples, there is little to no reason to use them in 2d games. Where i show them, it's because I thought I would be easier to understand by complete begginer. Maybe youre right, it might be confusing, it will avoid it next time

    • @UnityForge
      @UnityForge  ปีที่แล้ว

      +im showing function that makes quaternion form 2 vectors (FromToRotation). I used getting an angle to showcase Quaternion.Euler, because I wanted the example not to be static and making it this way is common practice, while dealing with topdown movement as a begginer

    • @angeldude101
      @angeldude101 ปีที่แล้ว

      @@UnityForge Going from the sides of a right triangle, to an angle, to the sides of a right triangle seems like a lot of wasted energy for "common practice."
      Regarding quaternions in 2D, again, it's somewhat wasted energy, especially since most compilers won't optimize multiplying by 0 due to f̸͖̽l̵̥͗o̷̥͋ȁ̷̜t̶̤̾î̴̥n̸̨͌ḡ̶̨ ̵̘͐p̷̬͌o̷͓̊i̴̫̇n̶̥̍t̴̪̕, but complex numbers also have a few properties that don't extend to quaternions which could mislead some people when trying to move from 2D to 3D. So for demonstration, using quaternions is probably fine as long as it's clear that one should use the right tool for the job.

    • @UnityForge
      @UnityForge  ปีที่แล้ว

      @@angeldude101 yeah you are probably right, I will remake this video some time in the future accoring to your points, also i feel i could explain it much more clearly. Trust me i chcecked many tutorials and forums and i found quite a lot of this "common practice" or maybe i can't google well, which is more likely

    • @angeldude101
      @angeldude101 ปีที่แล้ว +1

      @@UnityForge Honestly, I wouldn't be too surprised if it _was_ common practice, and from what little I've seen on my own, I would agree. I just think it's _silly_ that it's common practice when expanding the function calls reveals how it's literally just plugging the result of atan into sine and cosine, when the inputs to atan _are the sine and cosine._

  • @roronoa_d_law1075
    @roronoa_d_law1075 ปีที่แล้ว +3

    0:18 LMAOOO I can 100% relate to this

    • @Sparkiiiy
      @Sparkiiiy 3 หลายเดือนก่อน

      FRFRFR

  • @gostan2718
    @gostan2718 8 หลายเดือนก่อน +1

    bro this is so funny I subscribed.

  • @ArThur_hara
    @ArThur_hara 14 ชั่วโมงที่ผ่านมา

    3:00 what music is this

  • @Zibit21
    @Zibit21 7 หลายเดือนก่อน

    Mega-helpful video!

  • @acousticcallum
    @acousticcallum 11 หลายเดือนก่อน

    I think the reason no one uses Quaternion.AngleAxis is because you can just use Quaternion.Euler with the the angle multiplied by the normalized axis. If you want to rotate A degrees around axis B you just do Quaternion.Euler(A * B.normalized)

  • @dumblegeorge
    @dumblegeorge 8 หลายเดือนก่อน

    thank you very much for this video you explained it so well

  • @jackbotman
    @jackbotman 9 หลายเดือนก่อน

    Quaternion: Let's represent 3D rotation using a 4th dimension
    Big brain time, bois.

  • @thetruebeginner4382
    @thetruebeginner4382 ปีที่แล้ว

    Great video! Also where is your spaceship game available for download?

    • @UnityForge
      @UnityForge  ปีที่แล้ว +2

      Not yet, it relatively new concept and I don't work at it as much as I would like to because i'm starting collage therefore I'm working at the factory to earn some money. You can check out my other game, it's called GravAssist and is on google play

  • @protonproductions
    @protonproductions ปีที่แล้ว

    I an trying to rotate objects to a certain angle using Quaternion.Euler but it does not seem to work:(
    //_rotY is set through inspector for eachh of the 4 objects.
    transform.parent.rotation = Quaternion.Euler(0, _rotY, 0); //wrong rotation
    _parentAnim.speed = 0f;
    meshRenderer.material.SetColor("_TintColor", new Color(1f, 0, 0, 10 / 255f));

    • @UnityForge
      @UnityForge  ปีที่แล้ว

      Try doing it with hardcoded values (eg. transform.parent.rotation = Quaternion.Euler(0, 45, 0);), if it works corretly it's _rotY fault. Also remember you are setting global rotation, if you're intending to set the local rotation (rotation relative to the parent object), you should use transform.parent.localRotation instead of transform.parent.rotation.

  • @CharleyThePostman
    @CharleyThePostman 10 หลายเดือนก่อน

    Wonderful!

  • @Zicore47
    @Zicore47 ปีที่แล้ว

    I still don't understand how I rotate around X and Y only and locking Z...

  • @watercat1248
    @watercat1248 10 หลายเดือนก่อน

    I don't have any question but it's very hard to remember all those rotesion faction's
    I need to watch this video wean need them in the order to understand how they works.

  • @toot8208
    @toot8208 10 หลายเดือนก่อน +1

    i love you.

  • @fv4202x
    @fv4202x ปีที่แล้ว

    0:31 No I can!!!! **spends entire life to learn it to prove u wrong**
    No one going to deal with that. Every content creator should talk certain like this instead of creating 20 sentences to explain.

  • @tym3k257
    @tym3k257 ปีที่แล้ว +1

    łapka w dul

  • @icefresh983
    @icefresh983 ปีที่แล้ว +2

    first

  • @lemetamax
    @lemetamax 9 หลายเดือนก่อน

    Now, explain quaternion. Not Quaternion.
    The one with a lower q😅