How to make an FOV slider in Godot 4!

Поділитися
Вставка
  • Опубліковано 20 жов 2024

КОМЕНТАРІ • 19

  • @ahmed_mo2nis_productions
    @ahmed_mo2nis_productions 6 місяців тому +1

    I used to save each individual setting into a text file. But this is more efficient. Thank you Sir.

  • @GoDogGame
    @GoDogGame 6 місяців тому +1

    I followed this last night with no issues, thanks a ton for this. I learned a lot. I still don't quite understand why we needed 3 different scripts but it works. I'm gonna try to find another way though because I'll go crazy having the logic separated around so much.

    • @Chaff_Games
      @Chaff_Games  6 місяців тому +1

      The most direct way is to connect the value changed signal on the slider directly to the camera or the player.
      I touched on it lightly here but the main reason for this is when the game gets complicated and you’re trying to get a slider to hit an object 3 scenes deep it’s a lot easier to just subscribe to the signal. This could also just be done with 2 scripts but I elected to store the data in a resource.

    • @GoDogGame
      @GoDogGame 6 місяців тому +1

      @@Chaff_Games I learned so much from this tutorial such as connecting signals in script, but I was not able to understand the resource aspect of it or how it saves this data. All I really have to go on is "Extends Resource" but its a .gd, a script, so I don't really understand lol
      And then when I search my computer for the .tres file saved I can't find it anywhere. Figured it should be somewhere close by since we are setting the directory save_file_dir: String = "user://save_data/"
      I'm a beginner as you can see I still have a fundamental misunderstand of signals but what works works! I am now trying to implement the resolution button (from your previous tutorial) into this saved resource system and am pulling my hair moving around between 4 different places trying to track and find out where I am going....
      I think I need a break lol

  • @samuelmarshalaz
    @samuelmarshalaz 6 місяців тому +1

    Just recently found your channel. Really appreciate the videos man keep it up

  • @donglers
    @donglers 2 місяці тому

    spent hours trying to figure out what you laid out in 3 minutes imma cry

  • @daemonsmith9814
    @daemonsmith9814 5 місяців тому

    are your Courses still on Udemy? the links dont seem to work

    • @Chaff_Games
      @Chaff_Games  5 місяців тому

      The content was updated onto UA-cam.

  • @gli7ch240
    @gli7ch240 6 місяців тому +1

    I'm having trouble with your fps kit I am using the free one but I added a new weapon with the resource and removed the starter weapons and my game freezes I'm on mobile if this makes a difference

    • @Chaff_Games
      @Chaff_Games  6 місяців тому

      No problems jump on the discord and we can work it out.

  • @echoless3484
    @echoless3484 4 місяці тому +1

    How do i do this with a dropdown

    • @Chaff_Games
      @Chaff_Games  4 місяці тому

      Connect the signal and apply the result with the value chosen.

    • @echoless3484
      @echoless3484 4 місяці тому +1

      @@Chaff_Games ima join your discord a lotta stuff isn't working lol

  • @roccoruscitti910
    @roccoruscitti910 6 місяців тому +1

    I wondered if anyone else would make a video like this eventually. GDQuest made a video on the subject, but had to post a correction because the resource class is inherently unsafe.
    ua-cam.com/video/j7p7cGj20jU/v-deo.html
    basically, resources can contain internal resources which can have a script that extends it with an init() function that executes some arbitrary code when loaded. this is a software vulnerability.

    • @Chaff_Games
      @Chaff_Games  6 місяців тому

      I swear I’m this is the last tutorial I do 😭. So over it. Also could you not just save your resources in .res. It’s not human readable then.

    • @roccoruscitti910
      @roccoruscitti910 6 місяців тому +1

      @@Chaff_Games good question. I'm not sure. I think because .res and .tres are translatable (they convert back and forth seamlessly without serialization) I think attackers can convert a .res to .tres, alter it with a hack and then convert back to .res. so to the user it appears safer but is in fact more dangerous now because it cannot be viewed easily in human readable way to check for hacks.
      Honestly though, when people talk about using resources for enabling modding In Their games the answer is most often "well people need to make sure themselves if the mods are safe, even in other games not made in Godot, and this is often done by the modding community. So I think it's the same with save files etc. sure it is a vulnerability, but the end user should really only be downloading game files from trusted sources. If they run a hacked save file, that isn't on the developer.
      I did notice though on rewatch of the gdquest video it was for pre Godot 4. And they were in talks with Godot devs to try and make resources safer. So maybe it was done already.

    • @roccoruscitti910
      @roccoruscitti910 6 місяців тому

      @@Chaff_Games your tutorial was good. Don't worry about not knowing everything about Godot or it's weaknesses. My point was just that, clearly the information about resource safety hadn't disseminated through the community enough. This was bound to happen to someone at some point so don't beat yourself up. But, I know your pain. The biggest worry when we put ourselves out there , on the line is that someone is just waiting to knock us off the first chance they get. The people who succeed are the ones who get back on the line and learn to do karate while keeping balance.

    • @Chaff_Games
      @Chaff_Games  6 місяців тому +1

      @@roccoruscitti910 Yes, I've was thinking on this over the night. Even if you made it .res it wouldn't matter because the attacker could just make whatever resource they wanted and save it as a .res. the loader is just looking for a matching name and since init runs first the rest of the data doesn't matter. So they just replace their file.
      For a settings file. This all probably won't matter because why would download someone else's setting file. But if there is a vulnerability and you can control for it. you should. So realistically you should spend the extra 10 minutes or so making a dictionary and json file to store the data.

    • @Chaff_Games
      @Chaff_Games  6 місяців тому +1

      @@roccoruscitti910 just to update. I was able to replicate in Gdquest's example in godot 4.2.