Unity Quick Guide - FPS Head Bob + Stabilization

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

КОМЕНТАРІ • 176

  • @hero3d899
    @hero3d899  3 роки тому +89

    I FORGOT TO SHOW THE PLAY MOTION METHOD BUT ITS SUPER SIMPLE
    Private void PlayMotion(Vector3 motion){
    _camera.localPosition += motion;
    }
    YOU ALSO SHOULD PROBABLY CALL THE RESET METHOD SOMEWHERE ELSE LIKE BEFORE THE BOOLS IN CHECK MOTION INSTEAD OF UPDATE

    • @hero3d899
      @hero3d899  3 роки тому +4

      @@inigowilloughby7285 sorry for the incredibly late reply, didn’t see this ): I’m sure you have resolved but in case anyone else needs, I would put it anywhere before our returns in check motion, so above or below where we set the local speed variable.

    • @octobuter9872
      @octobuter9872 3 роки тому +4

      @@hero3d899 well, it still doesn`t work :/

    • @erikuploads3786
      @erikuploads3786 2 роки тому

      @@hero3d899 it says that there is no definition for velocity please help

    • @desawwww
      @desawwww 2 роки тому

      @@Llamu maybe you wrote it wrong

    • @jkcruz7712
      @jkcruz7712 2 роки тому

      Works great! I’m using a rigid body instead so I just changed character controller to rigid body and it works nicely

  • @W00JDA
    @W00JDA 3 роки тому +156

    Didn't know Cr1tical made Unity videos

    • @gigabit6226
      @gigabit6226 3 роки тому +6

      I didn't know Cr1tical existed. I only know Cr1tikal.
      Jokes aside, I like the Amon pfp

    • @destroyanad8651
      @destroyanad8651 2 роки тому +6

      lmfao ikr, i thought the same thing

    • @ItzzNPC
      @ItzzNPC 28 днів тому

      ikr

  • @TheZombersLMAO
    @TheZombersLMAO 2 роки тому +48

    this dude sounds like he's gonna tell us our daily dose of internet

  • @Snoroz
    @Snoroz Рік тому +12

    I've translated the tutorial code for an FPS game I'm making into Python and it works! Thank you very much.

  • @ConcreteJungleGames
    @ConcreteJungleGames Рік тому +5

    Love the quick snappy instruction delivery... Makes me feel good inside. You've gotchurself a new subscriber!

  • @epictrollmemeface3946
    @epictrollmemeface3946 3 роки тому +16

    Charlie makes Unity programming tutorials

  • @lookatDev
    @lookatDev Рік тому +72

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    public class Headbob : MonoBehaviour
    {
    [Header("Configuration")]
    [SerializeField] private bool _enable = true;
    [SerializeField, Range(0, 0.1f)] private float _Amplitude = 0.015f; [SerializeField, Range(0, 30)] private float _frequency = 10.0f;
    [SerializeField] private Transform _camera = null; [SerializeField] private Transform _cameraHolder = null;
    private float _toggleSpeed = 3.0f;
    private Vector3 _startPos;
    private CharacterController _controller;
    private void Awake()
    {
    _controller = GetComponent();
    _startPos = _camera.localPosition;
    }
    void Update()
    {
    if (!_enable) return;
    CheckMotion();
    ResetPosition();
    _camera.LookAt(FocusTarget());
    }
    private Vector3 FootStepMotion()
    {
    Vector3 pos = Vector3.zero;
    pos.y += Mathf.Sin(Time.time * _frequency) * _Amplitude;
    pos.x += Mathf.Cos(Time.time * _frequency / 2) * _Amplitude * 2;
    return pos;
    }
    private void CheckMotion()
    {
    float speed = new Vector3(_controller.velocity.x, 0, _controller.velocity.z).magnitude;
    if (speed < _toggleSpeed) return;
    if (!_controller.isGrounded) return;
    PlayMotion(FootStepMotion());
    }
    private void PlayMotion(Vector3 motion)
    {
    _camera.localPosition += motion;
    }
    private Vector3 FocusTarget()
    {
    Vector3 pos = new Vector3(transform.position.x, transform.position.y + _cameraHolder.localPosition.y, transform.position.z);
    pos += _cameraHolder.forward * 15.0f;
    return pos;
    }
    private void ResetPosition()
    {
    if (_camera.localPosition == _startPos) return;
    _camera.localPosition = Vector3.Lerp(_camera.localPosition, _startPos, 1 * Time.deltaTime);
    }
    }

  • @r.f886
    @r.f886 2 роки тому +31

    WOW the most useful 1 min 16 seconds of my life. Thank you 😃

  • @obsleet
    @obsleet 2 роки тому +9

    It's crazy. This was working great for me, but then I saved my project, reloaded it, and now I can't look up or down and moving forward makes my camera look up. I'm sure it has something to do with the lookat. As everything works when I disable the head bob script. Just weird.

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

    Thanks this works great! it took just a little working out but I got it working now.

  • @teixloc943
    @teixloc943 Рік тому +16

    Hey guys, if any of you are using a rigidbody controller then this code will work,
    In unity, unparent the camera holder from the player
    set CamPos to an empty game object of where you want the camera to be default
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    public class ViewBob : MonoBehaviour
    {
    [SerializeField] bool Isenabled = true;
    [SerializeField, Range(0, 0.1f)] float amplitude = 0.015f;
    [SerializeField, Range(0, 30)] float frequency = 10f;
    [SerializeField] Transform cam = null;
    [SerializeField] Transform cam_holder = null;
    [SerializeField] Transform campos = null;
    float togglespeed = 1.0f;
    Vector3 startpos;
    Rigidbody controller;
    Movement movement;
    void Start()
    {
    startpos = campos.localPosition;
    controller = GetComponent();
    movement = GetComponent();
    }
    // Update is called once per frame
    void LateUpdate()
    {
    cam_holder.position = campos.position;
    cam_holder.position = campos.localPosition + cam_holder.position;
    CheckMotion();
    cam.LookAt(FocusTarget());
    }
    Vector3 FootStepMotion()
    {
    Vector3 pos = Vector3.zero;
    pos.y += Mathf.Sin(Time.time * frequency) * amplitude / 100f;
    pos.x += Mathf.Cos(Time.time * frequency / 2) * amplitude / 50f;
    return pos;
    }
    void CheckMotion()
    {
    float speed = new Vector3(controller.velocity.x,0f,controller.velocity.z).magnitude;
    ResetPosition();
    if (speed < togglespeed) return;
    if (!movement.grounded) return;
    PlayMotion(FootStepMotion());
    }
    void ResetPosition()
    {
    if (cam.localPosition == startpos) return;
    cam.localPosition = Vector3.Lerp(cam.localPosition, startpos, 1 * Time.deltaTime);
    }
    Vector3 FocusTarget()
    {
    Vector3 pos = new Vector3(transform.position.x, transform.position.y + campos.localPosition.y, transform.position.z);
    pos += cam_holder.forward * 15f;
    return pos;
    }
    void PlayMotion(Vector3 motion)
    {
    cam.localPosition += motion;
    }
    }

    • @hatdogngnanaymo2893
      @hatdogngnanaymo2893 Рік тому +2

      What is the first movement in
      Movement movement;?

    • @michaeloustayan3849
      @michaeloustayan3849 Рік тому +1

      @@idkguy_. so he called his player movement Movement but you probably called it something else. You have no MonoBehaviour named "Movement"
      But you're written code that expects it to exist. I call my player movement PlayerMotor.

    • @Sum_dev
      @Sum_dev 10 місяців тому

      what is Campos?

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

      doesn't seem to work.

  • @pickle2835
    @pickle2835 2 роки тому +2

    It just doesn't work for me. There's no errors and I've been trying different stuff for a while now.

  • @justanotherhuman9238
    @justanotherhuman9238 2 роки тому +6

    Everything works fine till I look either fully up or down, at which point the camera snaps to a weird rotation. Pretty sure it has something to do with the focus target, but not sure how to fix. Help would be appreciated.

    • @Guidoge
      @Guidoge Рік тому +1

      use a mathf.clamp on the cam and the cam rotation should be done with * Time.fixedDeltaTime

  • @XCA7IBUR
    @XCA7IBUR 2 роки тому +4

    it's still not working, when are you going to release the code? it's not that hard to copy paste it into your description

  • @RestlessDeveloper
    @RestlessDeveloper 2 роки тому

    FINNALY A TUTORIAL FOR HEAD BOB

  • @sohodollie7643
    @sohodollie7643 Рік тому +1

    If moist critikal made tutorials

  • @quantumplayzgaming
    @quantumplayzgaming Рік тому +1

    It didn't work for me. I checked my code over and over but it wouldn't compile for some reason.

  • @dankodev
    @dankodev Рік тому

    For the first few seconds I thought you were Moist Cr1TiKaL

  • @DarkMonarch0
    @DarkMonarch0 2 роки тому +11

    For anyone who is doing this with a rigid body, all you have to do is call upon a rigid body instead of a character controller (private Rigidbody _controller;) then when it asks for the get component changed it too (_controller = GetComponent();), however i found out that you need to add your own "isGrounded" check so for that i added a Floormask ([SerializeField] private LayerMask FloorMask;) and a "feet"(the feet needs to be a empty object at the bottom of your player) transform ([SerializeField] private Transform FeetTransform;) once youve set the "ground" to the floor mask, go to the CheckMotion and change the "isGrounded" to a (if (!Physics.CheckSphere(FeetTransform.position, 0.1f, FloorMask)) return;) to put it simply this checks if your "feet" are touching the floormask and id they are then continue. hope this helps someone ¯\_(ツ)_/¯

    • @shakibdewan7441
      @shakibdewan7441 2 роки тому +1

      Man, this was very helpful! I was stuck with the same problem. Thanks a lot! :D

    • @zdxqi_8941
      @zdxqi_8941 Рік тому

      bro the FloorMask isnt WOrking on !_controller.Floormask) return

    • @nayefmsh8274
      @nayefmsh8274 Рік тому

      doesnt work for some reason

    • @id2450
      @id2450 10 місяців тому +1

      thanks man

  • @Harry-dh2pm
    @Harry-dh2pm 3 роки тому +6

    Like others, I followed all the steps, and it doesn't work. No errors or anything, just no head bob.
    3 hours or rewatching the same 1 minute clip darrting around with no context, double checking I missed some stupid typo rather than a 2 second pastebin. FML.

    • @hero3d899
      @hero3d899  3 роки тому +1

      Sorry you had so much trouble, this video was definitely a bit of a mess lol. I have since started including the code for these projects and will try to come back / update these old ones.

    • @TwistedAMV
      @TwistedAMV 3 роки тому

      @@hero3d899 Please do soon, love the video, but it just ain't working for me. :(

    • @bleopminecraft
      @bleopminecraft 2 роки тому

      @@hero3d899 Its been 4 months could you pls include the code now

    • @pickle2835
      @pickle2835 2 роки тому

      @@hero3d899 pleassssssssssssssssssse

  • @Jeamar
    @Jeamar 2 роки тому +3

    Hey! Weird issue here, on project it works perfectly, but when I build the game, nope, zero headbob, tried rearranging script execution order but it effed it up more, any ideas what could it be?

    • @Jeamar
      @Jeamar Рік тому

      @@bfrawg I think I did not fix it

    • @oscarbustos
      @oscarbustos Рік тому

      void awake instead of start

  • @RGBA
    @RGBA 2 роки тому +8

    can you do tutorial on landing camera effect where the camera goes down smoothly and after like 0.1 second it goes back to the position smoothly?

    • @Llamu
      @Llamu 2 роки тому +1

      I think he's dead

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

    My controller.velocity x and y seems to be 0 due to the script probably executing after Move function, which makes my headbob not trigger, how do i fix this?

  • @Geckotr
    @Geckotr 2 роки тому +1

    is camera shaking also when you land after a jump with this script?

  • @quaranteen2757
    @quaranteen2757 3 роки тому +12

    I followed everything and got no errors yet it still won't work.

    • @quaranteen2757
      @quaranteen2757 3 роки тому +2

      Does anyone know what I might have done wrong?

    • @RattleCageful
      @RattleCageful 3 роки тому +3

      me too

    • @wolfie3657
      @wolfie3657 3 роки тому

      same

    • @Hyphen3372
      @Hyphen3372 2 роки тому

      its probably because you might be using a rigidbody instead of a character controller or you havent made a movement contoller.

    • @heyimandrewbofo
      @heyimandrewbofo 2 роки тому +1

      @@Hyphen3372 did it work to you bro?

  • @bvra155
    @bvra155 3 роки тому +10

    This doesnt work for me . Can you help please?
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    public class HeadBobController : MonoBehaviour
    {
    [SerializeField] private bool _enable = true;
    [SerializeField, Range(0, 0.1f)] private float _amplitude = 0.015f;
    [SerializeField, Range(0, 30)] private float _frequency = 10.0f;
    [SerializeField] private Transform _camera = null;
    [SerializeField] private Transform _cameraHolder = null;
    private float _toggleSpeed = 3.0f;
    private Vector3 _startPos;
    private CharacterController _controller;
    private void Awake()
    {
    _controller = GetComponent();
    _startPos = _camera.localPosition;
    }
    void Update()
    {
    if (!_enable) return;
    CheckMotion();
    ResetPosition();
    _camera.LookAt(FocusTarget());
    }
    private void PlayMotion(Vector3 motion)
    {
    _camera.localPosition += motion;
    }
    private void CheckMotion()
    {
    float speed = new Vector3(_controller.velocity.x, 0, _controller.velocity.z).magnitude;
    if (speed < _toggleSpeed) return;
    if (!_controller.isGrounded) return;
    PlayMotion(FootStepMotion());
    }
    private Vector3 FootStepMotion()
    {
    Vector3 pos = Vector3.zero;
    pos.y += Mathf.Sin(Time.time * _frequency) * _amplitude;
    pos.x += Mathf.Cos(Time.time * _frequency / 2) * _amplitude * 2;
    return pos;
    }
    private void ResetPosition()
    {
    if (_camera.localPosition == _startPos) return;
    _camera.localPosition = Vector3.Lerp(_camera.localPosition, _startPos, 1 * Time.deltaTime);
    }
    private Vector3 FocusTarget()
    {
    Vector3 pos = new Vector3(transform.position.x, transform.position.y + _cameraHolder.localPosition.y, transform.position.z);
    pos += _cameraHolder.forward * 15.0f;
    return pos;
    }
    }

    • @aanteasl
      @aanteasl 3 роки тому

      Check if the controller.isGrounded returns false or if the speed is lower than the toggle speed.

    • @Llamu
      @Llamu 2 роки тому

      pretty sure you are missing some spaces in the serialize fields maybe idk

    • @sirgwindortvinuel
      @sirgwindortvinuel 2 роки тому

      @@Llamu space in c# don't really matter actually

    • @Llamu
      @Llamu 2 роки тому

      @@sirgwindortvinuel oh I didn’t know that

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

    which terrian texture and lightning you use ?

  • @lumeras115
    @lumeras115 2 роки тому

    Hey, I gotta quick question for ya. What theme do you use in Visual Studio? I know it's one of the base ones, but it looks nice and I don't enjoy the one I currently have.

    • @prilicat
      @prilicat 2 роки тому

      Dark maybe

    • @lumeras115
      @lumeras115 2 роки тому

      @@prilicat Huh, tried that a while back and no result

    • @lumeras115
      @lumeras115 2 роки тому

      @@ImmoralKoala Sure enough I got dark theme working

    • @ImmoralKoala
      @ImmoralKoala 2 роки тому

      @@lumeras115 For some reason I didn't even consider the date before posting, deleted it but damn you saw it fast lmao

  • @superhardcode
    @superhardcode 10 місяців тому

    how would you adapt this to work with a cinemachine virtual camera which has full control over the main cam?

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

    nice tutorial moist critical

  • @Mikelica69
    @Mikelica69 2 роки тому +1

    Super thank you!!

  • @Llamu
    @Llamu Рік тому +1

    Thats MoistCritikal and no one can tell me otherwise

  • @GavinBot
    @GavinBot 7 місяців тому

    for some reason. and this makes 0 sense at all
    The view bobbing works perfectly fine when I have the player selected in the hierarchy.
    but for some reason whenever I click off the player and deselect it. the view bobbing becomes heavily exaggerated.
    if anyone has any idea or whatever please let me know because this is baffling me.

  • @endgangwars
    @endgangwars Рік тому

    i was mainly concerned about getting it back to the original position but after watching this video i realized i can just use lerp...

  • @nasadachad298
    @nasadachad298 2 роки тому

    TY SO VERY MUCH MY POGCHAMP

  • @theeditor7265
    @theeditor7265 Рік тому

    i use an fps controller and it doesnt let me look down or up with the script help meh

  • @williamdev25
    @williamdev25 2 роки тому +4

    This is funny yet useful at the sametime.
    You are proobbabbllly the reason my game will stand out.

  • @octobuter9872
    @octobuter9872 3 роки тому +1

    did everything same, doesn`t work for me :/

  • @PauliPrints
    @PauliPrints 3 роки тому +1

    Im getting error code cs0116 any idea how to fix it?

  • @hex7shadow202
    @hex7shadow202 Рік тому

    not working but theres also no errors at the bottom of my screen pls help

  • @ruix
    @ruix Рік тому +1

    Thank you so much. I use godot so i had to tweak around a bit but it works fine.

  • @teo-chan
    @teo-chan Рік тому

    wouldnt be easyer to use an animation?

  • @romka9022
    @romka9022 3 роки тому +3

    If it doesn't work for you, try changing float speed to new Vector2(Input.GetAxisRaw("Horizontal"), Input.GetAxisRaw("Vertical")).magnitude

    • @Llamu
      @Llamu 2 роки тому

      no that just makes it worse

    • @romka9022
      @romka9022 2 роки тому +1

      @@Llamu worked for me

    • @Llamu
      @Llamu 2 роки тому

      @@romka9022 yes but as you can tell, it didn’t work for me

    • @romka9022
      @romka9022 2 роки тому +1

      @@Llamu well it can depend on your player controller, input system etc.

    • @Llamu
      @Llamu 2 роки тому

      @@romka9022 yeah that’s what I’ve been thinking

  • @epich307
    @epich307 9 місяців тому

    my camera goes away when I try to walk lmao

  • @LOLOGyt
    @LOLOGyt 2 роки тому

    Pls tutorial how make this lighing and post processing

  • @yousefsayed6380
    @yousefsayed6380 3 роки тому +2

    it doesn't work :/

  • @khajiit5556
    @khajiit5556 2 роки тому

    thanks bro
    !

  • @ilhamnarendra770
    @ilhamnarendra770 2 роки тому +1

    can you put all of the script in the comments instead ?, thank you

  • @panickal
    @panickal 2 роки тому

    Why not make the script public... I'll probably use an animation instead.

  • @Peter-wl9vj
    @Peter-wl9vj Рік тому +2

    source code?

  • @YadroGames
    @YadroGames 2 роки тому

    LookAt not working, FocusTarget Working

  • @calliope_x3
    @calliope_x3 2 роки тому

    Head bob works fine, but I can't look left and right now, anyone have any ideas?

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

    for the people can't get it to work, try checking the speed variable at the CheckMotion function, my speed always return 0 which is smaller than toggleSpeed so the function return instead of run PlayMotion for head bob

    • @sm1sm2sm3
      @sm1sm2sm3 2 місяці тому +1

      Where is PlayMotion() definition? I can't find it anywhere in the video!

  • @soundsaboutright1887
    @soundsaboutright1887 2 роки тому +1

    Sadly this doesent work

  • @jackcard4986
    @jackcard4986 Рік тому +4

    can anyone please CTRL + C, CTRL + V the code in here for the head bob script? I'm Lazy.

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

      Can you do that?

  • @mylescasey8914
    @mylescasey8914 2 роки тому +2

    Awesome tutorial + you sound like MoistCritikal ;)

  • @kam8527
    @kam8527 2 роки тому

    I am having an issue of the Head Bob just going too much to the sides, i cant really think of a solution and it has been driving me insane. Could someone help me out on this one?

    • @uvengine3219
      @uvengine3219 2 роки тому

      On the line:
      pos.x += Mathf.Cos(Time.time * _frequency / 2) * _amplitude * 2;
      you could multiply the _amplitude with a multiplier to dial down on the side movement

    • @kam8527
      @kam8527 2 роки тому

      @@uvengine3219 Thanks for reply,
      I have tried doing that but the end result is that it would simply vary in different set ups anyway as Time.time is very much frame dependant, I have tried to get it to work with DeltaTime but it would just result in the camera sliding off to one side (it probably is possible to get it working but my knowledge isn't big enough).
      So at the moment my only solution is to limit the fps and work around that.
      Once again thanks for the reply!

    • @dennisrust
      @dennisrust Рік тому

      @@kam8527 A solution is to divide the motion Vector3 by a value, try 30-40-50.

  • @pabloredondo5099
    @pabloredondo5099 2 роки тому

    0:59 How to make someone interested in stabilizing

  • @ghaformouden4909
    @ghaformouden4909 2 роки тому

    can u make a vidio about jitter fix
    thank a lot for the good tuto

  • @Robster881
    @Robster881 3 роки тому

    So the camera stuff never references any object and so the code doesn't actually dose anything. How do I fix this?

    • @hero3d899
      @hero3d899  3 роки тому

      it accesses the transform, so it will move what its attached to (camera). Make sure to also see my comment about the playmotion method, which I forgot to show. Sorry for the inconvenience :P

  • @forcepower7116
    @forcepower7116 3 роки тому +3

    He did it 🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥😋 thanks Bro

    • @hero3d899
      @hero3d899  3 роки тому +1

      No problem fam, make sure to check my comment as I forgot some stuff

    • @forcepower7116
      @forcepower7116 3 роки тому

      @@hero3d899 yeah thanks

  • @RHYSHALLDIGITALART00122
    @RHYSHALLDIGITALART00122 Рік тому

    ugh my brain

  • @dispat
    @dispat 3 роки тому

    it appears like the controller is taking my mouse as an input instead of my keyboard, who knows how to fix this?

    • @hero3d899
      @hero3d899  3 роки тому

      Sounds like your mouse and move axis inputs have been renamed from convention, just open up your input manager and check the names of each. I believe the default for mouse input is “Mouse X” and “Mouse Y”, move input is “Horizontal” and “Vertical”. But you can name them anything, just make sure you type in the appropriate name next to Input.GetAxis in code.

    • @dispat
      @dispat 3 роки тому

      @@hero3d899 it has the right name, also the script gets applied even if its not attached to anything lol

    • @hero3d899
      @hero3d899  3 роки тому

      @@dispat odd, I don’t think a monobehaviour could function without being attached to a transform.. check around for an old or duplicate script you have attached to something?

    • @hero3d899
      @hero3d899  3 роки тому

      @@dispat or perhaps create a new test file and apply this code only to verify if the problem is coming from your current project

    • @dispat
      @dispat 3 роки тому

      @@hero3d899 apparently the problem was related to having the camera in the camera holder or something like that, now im trying a different approach on head bobbing, thanks forr the help tho :)

  • @AzureBlue521
    @AzureBlue521 2 роки тому +2

    Plz Put The Script In The Description!!!

  • @bepo7000
    @bepo7000 8 місяців тому

    For me it works but after some time in the game it just stops. any help?

  • @Wiwhy
    @Wiwhy 7 місяців тому

    Bro, idk with the people dont leave the fking code

  • @en3tic391
    @en3tic391 3 роки тому

    Does this work with rigidbody?

    • @micr0wav3_able
      @micr0wav3_able 3 роки тому

      I'm wondering the same thing, idk if it will cuz he uses Character Controllers

    • @Hyphen3372
      @Hyphen3372 2 роки тому

      @@micr0wav3_able you can try

  • @longjohn7992
    @longjohn7992 2 роки тому

    Bro pls link code

  • @choppedandspewed
    @choppedandspewed 3 роки тому

    this shit is blursed. please don't stop.

  • @Danielingame
    @Danielingame 11 місяців тому

    you sound like moist critical lol

  • @TheRemaindersYT
    @TheRemaindersYT 11 місяців тому +1

    Moist critical????

  • @splatterling4539
    @splatterling4539 Місяць тому

    *sigh*

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

    I just want to let people know that is thinking in incorporating this head bobbing thing which is a useless-dumb-infuriating feature in their games you’re gonna lose a big chunk of players and sales and its very well deserved, it’s not realistic by any means, myself I sometimes do some jogging and your eyes are always focused and doesn’t make this stup!d movement, your head will move but not your vision, but it’s up to you, keep adding this and you deserve to fail miserably, there’s a reason why the biggest fps avoid this dizziness inducing garbage like a plague.

  • @maxp1ayz822
    @maxp1ayz822 2 роки тому

    Серьезно? А где гайд то этот? ты показал только не которые отрывки скрипта!

    • @Danyaanl
      @Danyaanl 2 роки тому

      Если полистать новые комментарии, там человек выложил рабочий код, правда мой персонаж не может почему-то двигать камеру по оси y

    • @maxp1ayz822
      @maxp1ayz822 2 роки тому

      @@Danyaanl да мне уже не надо)

  • @TheGravityChannel
    @TheGravityChannel Рік тому +2

    This works perfectly, all it needed was multiplying deltaTime with the result of the footstep vector3, anyone who's getting compiler errors or no head bobbing at all by following a 1:16 video should probably give up coding 😀

  • @khajiit5556
    @khajiit5556 2 роки тому

    тханкс фро

  • @patek2385
    @patek2385 2 роки тому

    Just use github next time.

  • @SensualSquirrel
    @SensualSquirrel Рік тому +2

    Please for the love of god stop adding head bob to games. It's not realistic. Nobody's vision moves like that as they walk. It just makes some of us have motion sickness. Please stop.

    • @toastystaken
      @toastystaken Рік тому

      so you want to walk around and feel like you have no animations whatsoever in video games? gotcha

    • @SensualSquirrel
      @SensualSquirrel Рік тому

      @@toastystaken yes. Just like real life. There is no head bob. Also all of the animations in the world don't matter if a game gives me motion sickness.

    • @toastystaken
      @toastystaken Рік тому +5

      @@SensualSquirrel real life has head bob, but most games overexaggerate it

    • @tako-bibibib
      @tako-bibibib 11 місяців тому +3

      are you a bird or something@@SensualSquirrel

    • @notChocoMilk
      @notChocoMilk 8 місяців тому +1

      it's far better than just a static camera, it makes games feel stiff without it.

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

    it does the head bob but it doesn't focus, what shuold i do

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

      when it focuses i connot move my mouse on y axes

    • @aoiSUB
      @aoiSUB 3 місяці тому

      @@aycicex You're most likely overriding the mouse input with the headBob. Create an empty object called HeadBob and try changing the position of it instead of the camera.