Rotate GameObject using mouse drag (Unity Tutorial)- 2019

Sdílet
Vložit
  • čas přidán 11. 09. 2024
  • how to rotate Game Objects using mouse drag in unity Games or Applications.

Komentáře • 19

  • @XtrimUniverse
    @XtrimUniverse Před 9 měsíci +1

    You don't even know what help you have done to me !! God bless you man !!

  • @RobertGercia
    @RobertGercia Před 3 lety

    I'm using Unity Input system. This code serves me well as a reference. Kudos to you sir!!

  • @DewaPoyo
    @DewaPoyo Před 2 lety

    Thanks for the tutorial. Definitely helps me to figure out how to mouse grab.👍👍

  • @Geckotr
    @Geckotr Před 3 lety +2

    how can i rotate the object with mouse click instead of drag?

  • @agustin9594
    @agustin9594 Před rokem +2

    Reset the rotation when mouse button up?
    private void OnMouseUp()
    {
    transform.rotation = Quaternion.identity;
    }

  • @Xundleus
    @Xundleus Před 9 měsíci

    I swaped the Rotate for RotateAround and started working.

  • @Xever2x
    @Xever2x Před 2 lety

    thank you!

  • @PrincessSleepyTV
    @PrincessSleepyTV Před 11 měsíci

    Don't forget the mesh collider.

  • @WhiteWilma
    @WhiteWilma Před rokem +1

    didnt work, but dont feel bad these never work for me 👍

  • @TrippleXD545
    @TrippleXD545 Před 5 měsíci

    lol no shit but can you get it to rotate based on the face you're clicking using raycasting - cause i cant

  • @agustin9594
    @agustin9594 Před rokem +1

    How can I block the Z rotation?

  • @y2k6485
    @y2k6485 Před 3 lety

    nice

  • @bettyrizzo6167
    @bettyrizzo6167 Před 2 lety

    is this secureteam?

  • @frankllinejay1662
    @frankllinejay1662 Před rokem

    Is it the same on touch?

    • @tylerscoding
      @tylerscoding  Před rokem

      I believe it should work the same with a touch screen I haven't tested that though.

    • @frankllinejay1662
      @frankllinejay1662 Před rokem

      I implemented this on one of my proj, but I can't use it in touch.