2D Projectiles in Unity - Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ก.ค. 2024
  • The very first video where I show you how I created my projectile system in Hidden Tactics. I hope you find it useful !
    Link to the scripts used in the video :
    www.dropbox.com/scl/fo/cvdsth...
    🌟 Whishlist Hidden Tactics on steam !
    store.steampowered.com/app/28...
    👇 Grab the ENTIRE MiniFantasy collection for your games 🤯
    krishna-palacio.itch.io/7wsgj...
    🙏 By using this link, you are supporting both me and Krishna Palacio, the awesome indie pixel artist behind the MiniFantasy Assets 💪
    Video Chapters:
    0:00 Intro
    1:12 Chapter 1 - Instantiating projectiles
    5:58 Chapter 2 - Curvature & speed
    15:01 Chapter 3 - Projectile rotation & shadow
    21:09 Chapter 4 - X axis implementation
  • เกม

ความคิดเห็น • 26

  • @robertoarmengol1899
    @robertoarmengol1899 หลายเดือนก่อน +9

    I think you have a good tutorial voice.

  • @ECAKJ
    @ECAKJ หลายเดือนก่อน +4

    You read my mind! This looks awesome. I’ve always wanted you to make tutorials. I’m curious how you did this in hidden tactics, along with how you did the animations since there’s a lot of weapons on seperate sprites. I’m still somewhat of a beginner

  • @g-han5565
    @g-han5565 หลายเดือนก่อน +3

    Damn... This is the type of tutorial which interests me. A very unique and reusable system. I'll be waiting for more tutorials then...

  • @fuyuminekimaya7571
    @fuyuminekimaya7571 หลายเดือนก่อน +2

    watching this at midnight was a bad idea. I actually got flashbanged by ur visual studio xD

  • @jutekpixel
    @jutekpixel หลายเดือนก่อน +1

    Really awesome :)

  • @EinfachMichii
    @EinfachMichii หลายเดือนก่อน +2

    Actuallly nice system. To improve it even further (performance wise), try to limit the amounts of scripts (MonoBehaviours). It might become pretty important, even in your game when you've got a insane amount of projectiles in the scene. Also think about Object Pooling, which is commonly used for systems like that. Great Job!

    • @ECAKJ
      @ECAKJ หลายเดือนก่อน

      yes object pooling would be a good addition for sure

    • @UnPawsGames
      @UnPawsGames  หลายเดือนก่อน

      Yep object pooling would be a great addition ! Thanks for your comment 😁

  • @ECAKJ
    @ECAKJ หลายเดือนก่อน +1

    Also curious how you change sprites on runtime. Like in Starve when you cut down trees or your last jam game with the plants growing

    • @UnPawsGames
      @UnPawsGames  หลายเดือนก่อน +1

      You can serialize the sprite renderer and different sprites, then set the spriteRenderer.sprite at runtime whenever you need it !

    • @ECAKJ
      @ECAKJ หลายเดือนก่อน

      @@UnPawsGames sweet! Ill try to figure out how to do that. Thanks!

  • @isaacpapillon8098
    @isaacpapillon8098 20 วันที่ผ่านมา

    I keep getting null reference exeption on every part of the code that reference the target but I set the target correctly I dont understand.

  • @ECAKJ
    @ECAKJ หลายเดือนก่อน +1

    Odds you can put the scripts in the description? I have no idea what Im doing wrong but I can not get it to work. I feel dumb, but trying to learn.

    • @UnPawsGames
      @UnPawsGames  หลายเดือนก่อน

      I just added them ! I hope it helps :)

    • @ECAKJ
      @ECAKJ หลายเดือนก่อน

      @@UnPawsGames you’re the best! Thank you

  • @pixgamesstudio5884
    @pixgamesstudio5884 หลายเดือนก่อน +1

    I can't seem to get it working when the enemies are moving

    • @UnPawsGames
      @UnPawsGames  หลายเดือนก่อน

      What do you mean by not working ?

  • @gabinchollet8153
    @gabinchollet8153 21 ชั่วโมงที่ผ่านมา

    Hi ! Thanks for the tutorial its very nice but i have a problem the projectile stay on the position of the shooter, it seem that he as no target so i retry and retry but it's still doesn't work, can someone help me ?

    • @gabinchollet8153
      @gabinchollet8153 21 ชั่วโมงที่ผ่านมา

      I usualy dont do that but i copy paste the scripts you put in the description but it dont work too

    • @UnPawsGames
      @UnPawsGames  20 ชั่วโมงที่ผ่านมา

      Hi ! For more help, feel free to join my discord server (its in many of my video's decription). Peoplr there will be glad to help you :)

    • @gabinchollet8153
      @gabinchollet8153 14 ชั่วโมงที่ผ่านมา

      @@UnPawsGames ok i'l join it thanks !

  • @ECAKJ
    @ECAKJ 16 วันที่ผ่านมา

    how can I set a new target?

    • @UnPawsGames
      @UnPawsGames  15 วันที่ผ่านมา

      You can do that through script! For example, find a new target using a detection method and replace the target in your script!

    • @ECAKJ
      @ECAKJ 15 วันที่ผ่านมา

      @@UnPawsGames thanks! I have a detection method, I guess im still too much of a beginner. I don’t know how to replace the target in script. How did you learn programming so fast?

    • @UnPawsGames
      @UnPawsGames  14 วันที่ผ่านมา +1

      @@ECAKJ You can go for : target = newTarget in you script, whenever your condition to change target is fulfilled.
      I'm full-time, so that gives me a lot of time to learn !