How To Make A Realistic FPS Flash Light ( Godot 4 )

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ก.ย. 2024

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

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

    I'm really hype about using Godot since 4.3 coming soon

  • @mertdurum8383
    @mertdurum8383 11 หลายเดือนก่อน +7

    This video actually helped me get a grasp of some concepts in Godot after transitioning from another engine. Thanks!

    • @Code_It_All
      @Code_It_All  11 หลายเดือนก่อน +3

      Glad it helped you.

  • @f1x_my_power
    @f1x_my_power 11 หลายเดือนก่อน +8

    Awesome tut, very detailed disclosure of the topic, great result at the end! To slightly more improve the volumetric effect you could increase the Volume size and Volume Depth in project settings.

  • @Benjamin_Thio70
    @Benjamin_Thio70 6 หลายเดือนก่อน +3

    Deserve more likes and views, good vid🎉

  • @Code_It_All
    @Code_It_All  11 หลายเดือนก่อน +21

    Please Note A Few Things:
    1. The flashlight effect seen in the intro is achieved by adding another SpotLight to the existing SpotLight as a child, then increasing it's radius and lowering it's brightness and fog.
    2. You should normalize the direction before multiplying it by the speed so you're always moving the same speed at any direction, to normalize just add .normalize() after direction, however since we're using the Lerp method it's not super obvious.
    3. If you set the camera acceleration too low then the flashlight can move way faster than the camera and move out the screen, you can try to limit the flashlight rotation to -90 and +90 based on the player's forward transform (head.basis.z),
    tell me in the comments if you want a video for it.
    4. Sometimes you can see the starting point of the flashlight when you look down, too fix that adjust the Z axis of the SpotLight.
    5. Since this video was more about the realistic aspect of a indie horror game I didn't implement the logic for turning it off and on, if you want a part 2 of this video where I fix all of these issues please like this comment.

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

      any chance you could throw the code or explain how to do the third one, limiting the max rotation? would be much appreciated

  • @AppMaker728
    @AppMaker728 หลายเดือนก่อน +3

    I might use Godot to make a horror game since I like horror movies

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

    Well done! I didn't know it was that easy to project an image. Instant subscribe 😎

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

    17:44 is what you clicked for

  • @TheSuperJLA
    @TheSuperJLA 11 หลายเดือนก่อน +6

    i believe you also need to normalize your direction so that you dont move faster when going diagonal.

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

      You are correct! You should normalize direction in any game you're making but I think in this example since we're using the Lerp function it's not super noticable.

  • @XNASCIMENTOGAMES
    @XNASCIMENTOGAMES 10 หลายเดือนก่อน +3

    Hello friend, congratulations on your work, I'm looking for content about Godot because I intend to start in the area of game creation, and I found your channel and found it very interesting, what do you recommend for me who wants to start in this area? start with 2d or 3d games?
    Tips, what to study, how to get started, free courses preferably (I'm unemployed at the moment hahaha)
    Thank you for your attention, peace and success for you and your channel!!!

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

      Hey man I'm happy you liked this tutorial, it really depends what you want to develop do you want to make 2d games ? Start with 2d, you like making 3d games then you should start with 3d, although if you learn any of them switching to next one shouldn't be hard.

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

    This man is sigmA

  • @Zu-hr1yz
    @Zu-hr1yz 6 หลายเดือนก่อน

    Found it really useful. Thank you! I would also like to see the solution of making flashlight turn on and off. But for now I'll try to figure it out myself.
    upd: Alright. I managed to solve it by changing the value of light energy. Idk if this is the best option in terms of performance.

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

      You can also make it invisible,
      hand.visible = !hand.visible

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

    it was a great video but since the character's body doesn't rotate neither does the flashlight and it clips behind the character and creates a shadow. But over all this video gives people a chance to learn the basics.

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

    this tutorial is awesome!!
    i followed it and it's perfect.
    only the spotlight can do a 360 (as in, turning it too much makes it face the player, where you can't even see the light anymore) which is a little bit odd. i don't know if this happens in the original code in the video.
    is there a way to stop that??

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

    It's out but it's 4.3 beta

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

    This is the fourth tutorial I've watched on flash lights. Your tutorial is good. EXCEPT one thing is really starting to bug me.... How do you turn the flashlight on and off. I don't think I've ever played a game in which the flashlight cannot be turned on /off yet after four tutorials from people clearly cleverer than I, and still I have yet to know how to do this.

    • @Code_It_All
      @Code_It_All  6 หลายเดือนก่อน +3

      Hey, Thanks for watching!
      The simplest thing that I can think of is this:
      If Input.is_action_just_pressed("YOUR_ACTION):
      hand.visible = !hand.visible

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

    If, say, i decided to choose my light source to be a candle, how would i extend the candle out?
    Should i use transform or translate or what should i do?

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

      If you mean an OmniLight then you could increase the radius, but I would say use a spot light with a high radius

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

    verry cool

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

    Hi I dont know if your gonna read this but,im struggling to make a switch for it like my input map is f and when i test for values using input func and if statememt to test if spotlight.show is true and and switch is pressed it doesnt work,well please give me another method on how to do this thanks,great coding btw😊

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

      Hello !
      You can toggle flashlight with this:
      if Input.is_action_just_pressed("action name"):
      hand.visible = !hand.visible

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

      @@Code_It_All awesome,your the goat thanks

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

    helloo my when i drag my flashlight left or right it goes diagonally upwards and downwards and if i drag my mouse up and down nothing happens with it? i donno what i did wrong HELP PLZ

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

      Make sure your code is exactly as mine,
      Also make sure you attach the scripts to the correct node.

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

    my camera goes diagonal i dunno why please help

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

      Hey, Are you sure you're NOT doing both of the rotations on the same node ?

  • @MichaelH-zb8gg
    @MichaelH-zb8gg 11 หลายเดือนก่อน

    Great tut....
    I built it as per the tut. But I have a small issue when you move around the light beam in the fog trails behind the light movement so the beam becomes really wide, like it has some persistence then when you stop movement the light beam is fine. Any idea what might be causing this ?

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

      Hi michael, I'm glad you enjoyed this tutorial, in dark scenarios the fog does leave behind a trail due to the Temproal Reprojection In The Volumetric Light Settings on World Environment Node. Just disable Temporal Reprojection or adjust the amount of it to get rid of the trail.

    • @MichaelH-zb8gg
      @MichaelH-zb8gg 11 หลายเดือนก่อน

      @@Code_It_All That worked, thanks again.

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

    I seem to get Null error on camera3D and hand

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

      Make sure you refence the camera and hand correctly,
      Or you can just export camera and hand and then drag them in the spot.

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

    Please don't add mouse acceleration to a FPS style head controller, that's awful to control and nausea inducing.
    I suppose it's useful to know how to do, especially for keyboard controls where acceleration is necessary, and controllers where it can be helpful. But it shouldn't be used for mouse input events, or at the very, *very* least be an option.

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

      I guess that depends on the person playing the game, also the example on this video was way too much, you would probably use a much reasonable value for acceleration in a real game.
      however I agree adding an option to disable this.

    • @asdfghjkl-jk6mu
      @asdfghjkl-jk6mu 3 หลายเดือนก่อน

      every fps game has camera smoothing, although not in the typical way you'd see here.

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

    🤩 *Promosm*

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

    Thanks mate!!