How to add dynamic weapon sway and recoil in Godot FPS

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ธ.ค. 2024

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

  • @SlushyWizard
    @SlushyWizard ปีที่แล้ว +13

    Holy moly, this was a fantastic video! Thanks for sharing your knowledge!

  • @Mop82-h4b
    @Mop82-h4b 8 หลายเดือนก่อน +5

    if you want just a little more juice on the weapon tilt you can add this to your weapon tilt function under the if statement
    weapon_holder.rotation.x = lerp(weapon_holder.rotation.x, input.y * weapon_rotation_amount, delta * 10)
    (you also need to add in a new variable at the top of the function called input_y and pass in your input_dir.y)
    This will make it so that moving back and forth causes the weapon to go up and down, down if forwards up if backwards

  • @palex.5375
    @palex.5375 2 หลายเดือนก่อน +1

    if anyone is having trouble clamping the weapon rotation.x and y values so your gun doesn't go behind you if you move your mouse too much
    write this in the weapon sway function:
    weapon_holder.rotation.y = clamp(weapon_holder.rotation.y, -0.8, 0.8)
    you can adjust the last 2 values to your liking

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

    best tutorial i've seen so far!

  • @MrRPss
    @MrRPss ปีที่แล้ว +3

    Thanks alot dude, found your video from the discord keep it up man this tutorials will blow up

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

    love your tutorials man, thanks for uploading

  • @Callsign_Sturm
    @Callsign_Sturm 25 วันที่ผ่านมา

    Extremely useful video!

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

    thanks man. this is what ive been lookin for

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

    Very good tutorial, but my gun does not return after the recoil hahaha, can anyone help me?

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

      Continuously lerp it to zero every frame

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

    Good tutorial but when you want to make a recoil for other burst types, the recoil is difficult to adjust with the curves and it does not return to its initial position , I have to constantly apply an interpolation to the original values of position and rotation of the gun.
    The video shows a single-shot but try an automatic or semi-automatic burst type

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

    exactly what i needed love you

  • @TheJungaBoon
    @TheJungaBoon  ปีที่แล้ว +2

    Added a Github link for the scripts

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

    Yo this is great thanks for posting it in the discord so I could see it

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

    An absolute banger of a video. Instead of wasting everyone's time unlike a lot of folks on YT, you went straight to the point and gave sooooooo many good advices. Thank you kindly!

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

    Hello JungaBoon! I wanted to thank you for this video. With it, I was able to reference and implement some of the cool features shown here in my FPS prototype (such as the weapon swaying). I just recently finished it and have published a video showcasing it on my page. I even put you in the game's credits page as a way to thank you.
    I'll be looking forward to future uploads from you! :^)

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

    Really impressive video. Definitely recommend time stamps.

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

    If anyone ends up wondering why their bobbing and swaying is completely wacky turn down the variables provided and you should get the results you want no problem.

  • @la.vibracion
    @la.vibracion 7 หลายเดือนก่อน

    great video! learned quite a bit from this one

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

    when fps are too high the sway is barely noticeable when it's too low the sway is very aggressive, how do you fix that?

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

    bro make a full fps controller and detailed one in just 10 min no in 6 hours and 30 videos the dude show us that hes into teaching no making us sleeping

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

    I always seem to have an issue where the gun doesnt go back to it's pre-recoil position

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

    can you send a link to the sketchfab viewmodel?

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

    Awesome video. Keep it up!

  • @mikeg.5140
    @mikeg.5140 ปีที่แล้ว

    Great vid. Keep up the good work.

  • @ElGhost-p6t
    @ElGhost-p6t 10 หลายเดือนก่อน

    10:20 Hello, your videos are really good, but there is an error on line 9 that describes the following: 'Could not find type "CameraShake" in the current scope', and if I fix this, it tells me to change the Node3D to a single node in camera_shake node . Can you help me?

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

    This is epic. thanks Jun 🙂

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

    hola podrias dar la arma que usas en el video

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

    What should I put in the Target of the weapon code?

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

    THX!

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

    I know it wasn't your tutorial, but I get an error when trying to add the camera shake effect. It's saying:
    " Invalid set index 'seed' (on base: 'Nil') with value of type 'int'. "
    any help would be awesome :)

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

      I'm guessing it has something to do with this line on the CameraShake script?
      func get_noise_from_seed(_seed : int) -> float:
      noise.seed = _seed
      return noise.get_noise_1d(time * noise_speed)

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

      Be sure to asign it in the weapon holder

  • @Justachillguy-c7f
    @Justachillguy-c7f ปีที่แล้ว

    for some reason its been taking me days to figure out how to fix cannot call method sample on a null value?? and also the apply_recoil() thing is not working. HELP ME FIX THISSSSSSSSSSSS

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

      I'll need a bit more detail. Could you post your code on here and reshare? That way I can see how you're implementing the method sample
      paste.myst.rs/
      One thing off the top of my head is that maybe you haven't set up a curve for the recoil?

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

    could you have the mouse controller the camholder y rotation instead and have the body react to that rotation? say if you have split upper body and lower body and just want to move the leg when the player moves too far.

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

      Sounds like it should work. Look into Dot Products to check if the player body's forward direction lines up with the current view forward direction. That's how I'd approach it off the top of my head, but I haven't tested that out yet.

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

    I noticed my event.relative is based on the fps (lower the fps higher the event.relative). Any way to fix this?

  • @НиколайСемченков-ф5ц
    @НиколайСемченков-ф5ц 9 หลายเดือนก่อน

    VERY COOL!!!!!!!!!!!!! THANKS YOU ❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤

  • @meezi2987
    @meezi2987 ปีที่แล้ว +2

    this is cool

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

    Hey man, I appreciated the tutorial! One small issue I'm having is the mouse input part. It tells me that it isn't being declared in the current scope when I have it in the input function. I don't if its because Im mixing this with my code or something. I would appreciate your help! have a great day. Much love from Indy. edit: nevermind found it!

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

      you need to add "var mouse_input = Vector2" if you look at the video at the part where he added all the @export var, you will see a bit down that he has "var mouse_input = Vector2" tho he didn't mention it.

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

    perfect

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

    Go-duh

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

    What about clipping into walls

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

      watch another tutorial on that

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

    i love you

  • @darknetworld
    @darknetworld ปีที่แล้ว +2

    Well it good but better to develop low polygon weapons and hands to be better visual how it work. Switch to simple to real feel off.

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

    What should I put in the Target of the weapon code?