Enemy Drop Items on % - 2D Platformer Unity #17

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

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

  • @GameCodeLibrary
    @GameCodeLibrary  11 месяцев назад

    At 3:28 I should have put the break inside the if statement :p woops! Went back to fix it and still did it wrong!
    So IF we instantiate, we break out of the loop.
    You add this break if you want your enemy to only drop one item.
    Grab all the required source files here!
    www.patreon.com/posts/enemy-loot-2d-17-94207787

  • @BrandonMerrington
    @BrandonMerrington 22 дня назад

    Cant express how helpful this video is.

  • @winter7843
    @winter7843 4 месяца назад

    Great tutorial, this code helped me a lot, thank you very much.

  • @xiannotfound
    @xiannotfound 7 месяцев назад

    Thanks for this tutorial !

    • @GameCodeLibrary
      @GameCodeLibrary  7 месяцев назад

      You’re welcome I’m glad you liked it! :-)

  • @fahripraz
    @fahripraz 11 месяцев назад

    actually if u dont mind, i have a problem with the isholding, and thats if i press hold and move to the other scene with that, the isholding keeps being true, and thats why i keep going back and back hahah, i have tried putting isholding false in the start, or even in the onsceneload, i also tried to put 2 scripts with different variables but same logic but i havent fixed it yet :"

  • @พิชเญศชมภูพรรณ
    @พิชเญศชมภูพรรณ 6 месяцев назад

    sorry is error
    Can you help me please
    Error CS0120 An object reference is required for the non-static field, method, or property 'LootItem.itemPrefab'and
    What should I do?

    • @GameCodeLibrary
      @GameCodeLibrary  6 месяцев назад +1

      Make sure your itemPrefab slot has a prefab inside it - you'll see in the video we drag a prefab in to the empty slot!
      You'll see it in unity under your LootItem :-)

    • @GameCodeLibrary
      @GameCodeLibrary  6 месяцев назад +1

      You can make a prefab by dragging a gameobject from the hierarchy to your assets folder, then you can drag it from your assets to the empty itemPrefab slot.

    • @พิชเญศชมภูพรรณ
      @พิชเญศชมภูพรรณ 5 месяцев назад

      @@GameCodeLibrary Thanks

  • @noobdev6464
    @noobdev6464 11 месяцев назад

    Nice and easy video. it will be nice to be able to buy items from a store in the map juste like hollow knight?

    • @GameCodeLibrary
      @GameCodeLibrary  11 месяцев назад +1

      A fun idea!! Perhaps we can use our gems collected on each level with a chance to spawn the shop, then spend gems to guy an extra max heart container 🤔
      I’ll be doing a series on rpgs next so will definitely have a shop there!!

    • @noobdev6464
      @noobdev6464 11 месяцев назад

      @@GameCodeLibrary nice cant wait,

    • @noobdev6464
      @noobdev6464 11 месяцев назад

      ​​@@GameCodeLibrary but i have a probleme whenever i colide from left or right i colect the amount 1 but if i colect from the top it add 2 and sometime 3 do u know why? Im using your coin counter from one of ur old video.

    • @GameCodeLibrary
      @GameCodeLibrary  11 месяцев назад

      @noobdev6464 could be because we disabled the coin in the previous coin video, but in this one we destroy the whole game object! Perhaps try replacing the disabling with destroying

  • @fahripraz
    @fahripraz 11 месяцев назад

    LEZGOOO