How to do FPS Smooth Crouching! - Ep. 3

preview_player
Показать описание
#gamedev #unity

We're going to building out smooth crouching in this video. We'll be handling objects above our heads, smoothing out the movement of the crouch, and more. Thanks for watching!

Рекомендации по теме
Комментарии
Автор

A way of making the crouching even smoother is by also moving the camera. I Lerp the camera position when crouching as well as Lerping the player controller height to make the camera go lower when crouching. I lerp the camera to the centre of the playcontroller (+ an offset so it isn't completely in the centre) when crouching and back to it's original position when standing. Since i am also lerping back, the movement is smooth cause the camera is now moving independently and is not affected by the jitter caused by the player controller pushing the ground.

But be careful, this might mess with your jump. To not mess up your jumping you need to do so the camera snaps to the centre of your player + an offset (wich has to be the normal distance the camera is from the centre of your player) when standing up. The same way Ajackster shows how to snap the height. That way you stand before jumping, therefore snapping your camera to an offset from the centre of the player, instead of lerping to the normal height it's at.

Hope this wasn't too confusing

zig
Автор

even in the videos it is visible the player is shuttering when it stands up
that transform position to move the player doesn't do anything

DevVand
Автор

The way you could avoid the effect you where talking about is by also changing the center of the character controller, instead of the center being in the middle of your controller when you crouch, the center on the Y could be lower so that it matches your height.

kostasathanasioy
Автор

but when i crouch the whole player is sinking

dumbguy
Автор

Hi! First of all thanks a lot for this tutorials, this is helping me a lot since I've only developed 2d games until now and Valorant has in my opinion one of the best movement systems right now in tactical fps. I have a question that is bothering me (I've been hitting my head 3 days straight on this). I need a fix for this problem, when i strafe left and right in Valorant, I can suddenly stop the movement by pressing the opposite key (e.g. if I press the A key to go left I can stop almost immediatly by pressing the D key). This doesn't happen when I try it and I would like to know a possible fix for this.Thank you so much again for the help! Hope you can help me.

valerioitalia
Автор

Hi Ajackster I'm having some problems with the crouching mechanic where I'm after uncrouching under the box, I'm stuck and can not move, my code is exactly the same as yours and unity comes up with no errors, if you have any solution as to why this could be happening please lmk thanks.

ToskiiiVAL
welcome to shbcf.ru