View bobbing script works fine on studio but breaks in-game

Hello, I’m working on a game and I’ve noticed that the view bobbing script I added in my game isn’t working as intended in-game, but works perfectly fine in studio

Note: The script isn’t mine, link to the script I’m using

On studio

In-game

Is it a Local Script or a Server Script?
Where is it located in the Explorer window?

If the script isn’t located in the right space it may work in Studio because Studio sees all the scripts as local since it’s all playing on your computer.
In-game is working off Roblox’s server, so the placement of local/server scripts can be affected.

1 Like

It’s a Localscript under StarterCharacterScripts, I’ve tried moving it under StarterGUI, StarterPlayerScripts, etc… yet the problem still stays

Apparently, this exact problem still applies with every single view bob script I’ve tried, either from the toolbox or made via tutorials

I have no idea what’s going on, this problem still persists even if it’s on a different game. Is this a bug?

It’s probably due to FPS since it uses RunService.

1 Like

I’ve capped my FPS and this seems to fix the problem, how could I fix this for players with uncapped FPS?

You could set the height offset using the modulo → % of time() and a specific number n

local offset = time() % n

and save the time when the player starts walking to offset it.

1 Like

My game decides to implode with bugs if I use a fps unlocker - #13 by tukars Might wanna look into this.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.