Respawn Enemy in Unity (2D Game Dev Tutorial)

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

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

  • @LostRelicGames
    @LostRelicGames  5 лет назад +1

    Hey guys! I'd love to get your feedback on the game I'm making, pls let me know what you think! : ruclips.net/video/t4jnuktZm7I/видео.html

  • @DharmaPunkGames
    @DharmaPunkGames 2 года назад +1

    This is such good content. It's really useful to see you thinking through the code as you go

  • @MegaJHONDY
    @MegaJHONDY 2 года назад +1

    Gran video, no hablo ingles pero pude entender lo que hizo

  • @nekit8742
    @nekit8742 5 лет назад +1

    Nice! Your videos inspire me for doing more. And thanks for respawn! Your videos help me a lot, thank you!!!!

    • @LostRelicGames
      @LostRelicGames  5 лет назад +1

      You have been a great supporter from the start. There will be more meaty videos soon - talking about game design philosphy, as well as some more detailed game making series. Have a nice day man! :)

    • @nekit8742
      @nekit8742 5 лет назад

      @@LostRelicGames Aawwwww, thank you. You too :D

  • @EduardoOliveira-yr3ib
    @EduardoOliveira-yr3ib 5 лет назад +1

    Your tutorials are exactly what i wanted, you're amazing!! Thank you!

    • @LostRelicGames
      @LostRelicGames  5 лет назад

      Kind words! I am glad you found it useful! Have a great day

  • @minimangamesrichminimangam7029
    @minimangamesrichminimangam7029 3 года назад +1

    Hey im having a issue where this the word spriteRenderer is underlined and i cant figure out a way to fix it; in the code:
    spriteRenderer.enabled = false;

  • @gambar
    @gambar 5 лет назад +3

    Insta sub :) Very useful guide! Please keep'em coming!

  • @EduardoOliveira-yr3ib
    @EduardoOliveira-yr3ib 5 лет назад +4

    You could create a playlist of all your 2d game dev tutorials, it would be very helpful tho

  • @bsigel32
    @bsigel32 4 года назад +2

    This code seems to work fine for a single spawn. What if I want to spawn multiple enemies at once? The code seems to work for the initial spawn but if I spawn a second time, they all want to spawn at the prefab coordinates. Any suggestions?

    • @LostRelicGames
      @LostRelicGames  4 года назад +1

      Hey Brian the system in the video is specific to re-spawning a single dead enemy. If you want to spawn many you will want to do it from a game manager using a for loop or something like that. Pop by the discord if you like and we can find you a solution.

  • @ozcanberberoglu7730
    @ozcanberberoglu7730 4 года назад +1

    I'm getting an error, help please.
    error: ArgumentException: The Object you want to instantiate is null.
    error line: GameObject enemyClone = (GameObject)Instantiate(enemyRef);

    • @kedarnadkarny4718
      @kedarnadkarny4718 4 года назад

      Did you get the solution for this?

    • @vamikagupta3187
      @vamikagupta3187 2 года назад

      in this case, I made a prefab GameObject that would be the enemy prefab that would be used for respawning the enemy. I used the prefab in place of enemyRef and it worked. It is only able to properly respawn once however, so take note of that. I will find a way to fix this issue very soon

  • @nekit8742
    @nekit8742 5 лет назад +1

    Hi! Please, can you make a tutorial about sliding?

    • @LostRelicGames
      @LostRelicGames  5 лет назад +2

      I've added it to my list! Sorry I am a little behing on my uploads. I'm submitting a game to IndieCade expo this week, and the paperwork involved has been a nightmare. I'll be back on track soon. Have a great Easter man

    • @nekit8742
      @nekit8742 5 лет назад +1

      @@LostRelicGames No problems! Just I wrote I would like to see ;) And good lcuk on IndieCade expo! Thank you, you too!! :D

  • @OmeedNOuhadi
    @OmeedNOuhadi 2 года назад

    Awesome man!

  • @Hugop_arts
    @Hugop_arts 3 года назад

    How would you set it so it only respawns once its off-camera?

  • @dragonballz3686
    @dragonballz3686 2 года назад

    Bro how to control the amount of enemies to be spawned from a position.

  • @gerardoortiz3173
    @gerardoortiz3173 2 года назад

    hey i just would like to say that the last link does not work

  • @antonisp8237
    @antonisp8237 5 лет назад

    Thank you mate!! Keep on teaching us ;p

    • @LostRelicGames
      @LostRelicGames  5 лет назад +1

      You are very welcome! I have a lot of good stuff planned for you! :)

    • @antonisp8237
      @antonisp8237 5 лет назад

      @@LostRelicGames Can't wait!

  • @jakobfalk4435
    @jakobfalk4435 4 года назад

    I just recently found your content and have the past few days binged your tutorials! Really great teaching! I've tried fixing an issue myself but cant seem to find the right workaround. When it respawns it removes the player gameobject from the enemy so it doesn't chase the player. I've used your other tutorial on enemy aggro. Btw Blood and Mead looks great :-)

    • @LostRelicGames
      @LostRelicGames  4 года назад +1

      Hey Jakob, thanks for the comment. The player will need to be re-assigned though a public property on the enemy.
      For this you will probably need to setup a game manager script, which is just like a "main" script that every game object can access. I'll have to make a video on it. But of you google "game manager singleton" it should give you some direction.
      You could also run a transform.Find("Player") from the enemy (only if it cant find the player) - But this Find function is a little dirty (it will do the job in the short term though)

    • @jakobfalk4435
      @jakobfalk4435 4 года назад

      @@LostRelicGames Great! Thank you! It is really cool, that you are so dedicated to help! I'll definitely support you on patreon. I'll try looking into a setting up a game manager. :-)

    • @jakobfalk4435
      @jakobfalk4435 4 года назад

      Looking forward to more videos!

  • @danielfernandobaquerorojas2141
    @danielfernandobaquerorojas2141 4 года назад

    Thanks!

  • @markoshivapavlovic4976
    @markoshivapavlovic4976 3 года назад

    nice video

  • @Skellens
    @Skellens 4 года назад

    you're awesome

  • @philfort2
    @philfort2 5 лет назад +1

    Most of your issues are caused by putting the respawn functionality on the object being respawned itself. Ideally that functionality should exist elsewhere (some object that is responsible for managing the playing field)
    I'm also not sure why you're loading from the Resources folder when you could just have a public GameObject field that is assigned the necessary prefab. The Resources folder has a number of issues, one being that files in there are not tracked so will always be included in the final game build even if they are no longer used by anything in your game. Another is that you're referencing by a string (weakly-typed).

    • @LostRelicGames
      @LostRelicGames  5 лет назад +1

      Thanks for the comment Philip, you make some great points! I'll be sure to cover those points in future videos. I try to keep things simple , as I imagine many people watching these videos are beginners, though sometimes as a result some unorthodox techniques may be used (i don't nessesaarily use these techniques in my own projects), - though still accepted within the unity framework. Again, thanks for the feedback!