Easiest way to make a crouching script

Hi there!

My current project is a custom movement script for a first-person singleplayer game (meaning that having a good looking character is unnecessary) and I am about to move on to making a crouching mechanic.

I’ve played around with this in the past (similar style on an older version of this project) and made something which vaguely works using TweenService to resize the various different parts (my custom character has 2 parts which need to be tweened). This worked well, however I ran into trouble with moving the part to a different place so it fitted within the dimensions required for the character. This is because the tween will take the position of the part you are tweening to at the point you press the crouch key, but will not update any further. This means if the player moves while the crouch tween plays, then a part will be left behind. I never managed to make something which constantly updates the position.

I’ve searched around and almost everyone uses animations for their crouch scripts, but I would guess this is because it needs to look visually nice as there will be more than one person on their game at a time. I’ve also seen that animations are more costly than tweens.

TL:DR: I want to know whether to use TweenService (which has some issues for the purpose that I want) or Animations (which is supposedly more costly) to make a crouching script.

Thanks for your help, and sorry for my bad explanations.

Are you intending to create a crouching system for R6 avatars or R15 avatars?

Probably didn’t make this clear enough, but as it is intended to be a singleplayer first person game I see no point in using either. I was just intending to do the bare minimum in having as few parts as possible (all with a functional non-cosmetic use) that the player will never see as they are locked into first person and there are no other players around. Obviously there’s a Humanoid within this as well.

This is why TweenService is what I have used and would absolutely be my method of choice if not for the fact that my current setup has the parts resize down into different positions which, while they are the right size, makes the total size of the player larger than it should be.

Hope this helps

you can simply change the humanoids hipheight if it’s an R6 character or something similar to it. If you’re character is in the default R15 you might need to do a different approach.