Bullet trail and muzzle flash Godot tutorial! (C# AND GDScript)

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 มิ.ย. 2024
  • Hey a quick tutorial on how to do bullet trail and muzzle flash in Godot (at least, how I did it).
    Link to the Github project:
    github.com/spimort/Godot-FPS-...
    Enjoy!
    #godot #gamedev #tutorial
    0:00 Intro
    0:19 Player scene
    0:36 Bullet trail scene
    1:05 Muzzle flash scene
    2:05 Player script
    3:13 Bullet trail script
    3:54 Muzzle flash script
    4:06 Demo
    4:15 Outro
  • วิทยาศาสตร์และเทคโนโลยี

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

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

    Great Tutorial! You are a life saver with your tutorials and terrain addon

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

      Thanks! I'm happy it helped you! 🙂

  • @M_SWasUnavailable
    @M_SWasUnavailable ปีที่แล้ว +4

    Great tutorial! I like how included both GDscript and C# and short tutorial straight to the point keep it up but a tip you dont need semi columns in GDscript

    • @spimortdev
      @spimortdev  ปีที่แล้ว +1

      Thank you, I'm glad you liked it!
      That's a fair point for the semicolon, I never do GDScript so I'm not aware of the good practices haha! It's a habit to put them.

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

    After alot of confusion on what all the Prefab things were. And the variables named after the types. I finally got it working. I just used downloaded and directly pointed to the objects. Thanks for this tutorial!

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

      Oh, I'm sorry for the confusion! Making tutorials is not my main thing, I'm not used to it, I still have a lot of improvement to do in that area.
      If I do another tutorial I'll try to use better terms!
      I'm glad you got it working anyway 🙂!

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

      @@spimortdev Oh no, its fine XD It actually helped me learn more. Instead of just copying I had to actually learn the terms

  • @Singleraxis
    @Singleraxis ปีที่แล้ว +1

    Finally got bullet trails from a Raycast working, thanks! As a newbie I had to work around your way of writing, I had no clue what prefabs are, but I just preloaded my trail variable and such. Also a little oversight was not putting the trail node on 'top level' under transform if anyone might stumble across it aswell, otherwise it will move with whatever you're shooting from.

    • @spimortdev
      @spimortdev  ปีที่แล้ว +1

      Hey thank you for your feedback!
      You are right, I totally forgot to talk about to "Top Level" in the video, I'm sorry!
      I had a recording of it and I was supposed to talk about it but I forgot, dang it.
      Also good to know that my way of naming things might be a bit confusing (ex. Prefab, which is not a word being used in the Godot world). I haven't done a lot of tutorial so far so that gives me places to improve, thanks!
      I'm glad you got it working at least 🙂!

    • @Singleraxis
      @Singleraxis ปีที่แล้ว

      @@spimortdev I'm trying to do an _on_area_entered when the trail hits an object, but it doesn't seem to work. Is there something with raycasts that it doesn't make it so easy?

    • @spimortdev
      @spimortdev  ปีที่แล้ว

      ​@@Singleraxis Well, the bullet trails does not have an Area on them the way I did it. It's intentionnal because I'm aiming at a "hitscan" type of gun, which means that the bullet trails are only a visual effect and the hit is instantaneous, there is no travel time (the bullet goes fast enough anyway so it's not too much noticable). The raycast itself is not an Area so it does not go inside of your event.
      If you want to add an Area on each trail, you can! But you also need to make sure that the trail does not go too fast so it misses the collision (for example, on thin walls).
      In my opinion hitscan are easier to implement and it gives good result :). Make sure tho that you enable the "Collide With: Areas" on the raycast so it sees the objects you want to collide with!
      I hope this helps! 🙂

  • @gamedev_byhobby8872
    @gamedev_byhobby8872 ปีที่แล้ว

    Great content as always, keep it up

  • @iamagenius2646
    @iamagenius2646 ปีที่แล้ว

    How did you add the line for the raycast? I mean how can you see it inside game for debug?

    • @spimortdev
      @spimortdev  ปีที่แล้ว

      This was only for demonstration but it was a simple mesh instance (a capsule) with a very long height 😁