Pick Up Objects with the Mouse in Godot 4 | Let's Godot

Поділитися
Вставка
  • Опубліковано 27 січ 2025

КОМЕНТАРІ • 22

  • @imn5531
    @imn5531 Місяць тому

    spending hours figuring out why it cant detect mouse, then thanks to you now I figured out the input pickable

  • @kawaiistalker8142
    @kawaiistalker8142 Рік тому +3

    dear mr.Dashnothing,
    Thank you for making such amazing tutorial, i love how you take time to explain everything in specific details. i wishes you the best of health and please make more educate content such as this.
    PS: can you also make a tutorial of how to make character move using mouse please

  • @Prosecutor_justice
    @Prosecutor_justice 28 днів тому

    0:30 mario galaxy reference

  • @trenom
    @trenom Рік тому +1

    good stuff man!

  • @ssk8053
    @ssk8053 Рік тому +1

    Good job very helpfull

  • @danbryandalisay8547
    @danbryandalisay8547 Рік тому +1

    For some reason when i collide with one item, all of my items in the world scene follow the movement with the first item i collide
    How to fix it?
    Thank you~

    • @DashNothing
      @DashNothing  Рік тому +1

      If your other items are children of the item you collide with, they will follow its position. Make sure your item nodes aren't nested within eachother in the world scene. Also make sure their common parent doesn't have its collision layer set to item as well.
      That's what I could think of might be the problem off the top of my head. Hope that helps!

    • @danbryandalisay8547
      @danbryandalisay8547 Рік тому +1

      @@DashNothing thank you so much i didn't notice that 😆

  • @magni319
    @magni319 3 місяці тому

    Does work for mouse, but just collides with player character like solid object

    • @DashNothing
      @DashNothing  3 місяці тому

      @@magni319 You have to adjust the item's collision layer so it doesn't do that

    • @magni319
      @magni319 3 місяці тому

      @@DashNothing Item is on Items layer with Player mask on and Player is on Player layer with Item mask on, right?

    • @DashNothing
      @DashNothing  3 місяці тому

      @@magni319 You don't need the item mask on the player

    • @magni319
      @magni319 3 місяці тому

      @@DashNothing doesn't work either way.

    • @DashNothing
      @DashNothing  3 місяці тому +1

      @@magni319 Check the item code. Did you do the var collision = move_and_slide() and then check if collision happened?

  • @ideepakgurung
    @ideepakgurung 6 місяців тому

    Is there any way that only on click item will be picked and not just on mouse_ entered? Thank you

    • @DashNothing
      @DashNothing  6 місяців тому +1

      @@ideepakgurungCollisionObject2D inherited nodes such as Area2D have a _input_event function and a _input_event signal. Both get triggered when the object is clicked by the mouse. The only prerequisite is the node has to have input_pickable set to true and any collision layer set.

    • @DashNothing
      @DashNothing  6 місяців тому +1

      @@ideepakgurung docs.godotengine.org/en/stable/classes/class_collisionobject2d.html#method-descriptions

    • @ideepakgurung
      @ideepakgurung 6 місяців тому

      @@DashNothing thanks buddy, will try it later

    • @ideepakgurung
      @ideepakgurung 6 місяців тому +1

      @@DashNothing thank you so much bro, it really worked

  • @agam3z153
    @agam3z153 7 місяців тому

    ASTONISHING
    +
    can i do it with (area2d) instead of (characterbody2d)

  • @khapham2220
    @khapham2220 Рік тому

    nice chanel