Pick Up and Throw Stuff in Unity 6! 2024 Tutorial

Поделиться
HTML-код
  • Опубликовано: 25 янв 2025

Комментарии • 16

  • @dsadawd_ch
    @dsadawd_ch Месяц назад

    That was very helpfull bro. Thank u

  • @biellodev
    @biellodev Месяц назад

    Awesome! I was looking for days how to do this and boom! A video on how to do it and updated for unity 6, ty ;)

  • @Yrekcaz7
    @Yrekcaz7 Месяц назад

    Right when i needed it! Thanks!!!

  • @deadman3824
    @deadman3824 18 дней назад +1

    This is the first in a long series of videos that has actually worked for me, thank you!
    Two questions -
    One, when I move my mouse quickly, the item drops. I assume this is because it registers that the object moves "outside" the mouse area (the "OnMouseExit" line) but is there a way to prevent this, so you could whip your mouse around and still prevent dropping the item?
    Two, is there a way to make it so you could pick up multiple items at once? The game I'm trying to make requires the ability to grab and carry/throw multiple items at once.
    I've also just now noticed that apparently, spheres do not like to be held. I can pick up a sphere object, but the sphere doesn't follow character movement, and will remain mostly stationary in the air. It follows the camera, but not the character walking.

    • @mattwester9093
      @mattwester9093  14 дней назад

      Glad it helped! I haven't seen the sphere issue so I will have to look into it to find a fix, but for the item getting dropped when moving the mouse quickly you are right that it is because of the OnMouseExit method. To stop it you'll have to get rid of the method and drop the item a different way, possibly using a raycast

  • @ashturnen3178
    @ashturnen3178 Месяц назад

    This is awesome! Subscribed.

  • @luxury8884
    @luxury8884 23 дня назад +1

    could you put the code in the descirption or in the comments
    please ?

  • @_foundd
    @_foundd 18 дней назад

    I love you. It was easily implementable into my interaction scripts. Thank you!!!!! I do have the issue that when flicking my mouse the item drops, any fixes????

    • @mattwester9093
      @mattwester9093  14 дней назад

      Glad it helped you! The reason the mouse flicking drops the item is because of the OnMouseExit method being called. Essentially the mouse moves faster than the item can keep up. Simple fix is just to remove the method and handle item dropping a different way

  • @klutch1139
    @klutch1139 17 дней назад +1

    it says " Temp Parent not found in scene" even though there is a temp parent object attached to my camera in the scene

    • @mattwester9093
      @mattwester9093  14 дней назад

      Be sure that your temp parent has the temp parent singleton script attached

  • @vamsikrishnagurram6931
    @vamsikrishnagurram6931 7 дней назад

    Hasn't worked