View Bobbing similar to the one in The Mimic

I’m trying to make a camera bobbing script which is supposed to look like the Mimics, but I have been having trouble creating it similar to that of the games. I’ve tried multiple scripts already, but my knowledge of scripting is too low to be able to even create one. I don’t have the scripts saved anymore sadly as I removed them, but I know that I’ve tried using Camera.CFrame for it.

In the video you can see that when you’re idle, the camera raises up in like a tan circular sort of wave.
I do not know how to simulate that, and when you walk I already know that there’s two separate view Bobbing scripts in there the left and right movement and the other one is the Camera.CFrame one where It’s like rotating if you get what I mean.

(Watch 2024-03-14 18-38-24 | Streamable)

2 Likes

I wrote a reply for something similar that has a lot of resources you can use:

The full reply:

Realism — Make your games feel more immersive!

  • My personal choice, though the camera sway comes from the animations instead of code, so it’s not as clean as doing it algorithmically. It’s drag and drop though, and adds lots of other immersive features for first person (I assume you’re doing a horror game from the reference).

The ones below are really simple to add, but this module lets you make immersive animations without view models and the client-server replication code you’d need for that. If you’re not looking for that, you can use the ones below (though I’d still recommend the foot step sounds from the one above, even if you disable the other features).

These might be good too:

Open FPC - A Modern First Person Camera System

  • (This one has everything to do with what you’re interested in)

First Person Camera Movement Sway and Idle Sway

Free Camera sway script (First Person)

EasyFirstPerson: Drag-and-drop first person view models!

One way of making this is you use a wave function like sine or cosine for the swaying, and use a spring module (Quenty has a great one in nevermore engine that I use) to smooth out the camera animations (a spring basically adds physics in a way, so you set a goal and it “springs” to the goal you set). You can also use the spring to add a “weighty” feel when you rotate the camera that feels immersive.

I would use the things above though, as they’re easier and probably mostly implemented at a fairly skilled level (realism especially).


Hopefully that reply is useful and maybe some of those work well for you!

Generally a mix of trigonometry equations like you mentioned (usually sin/cos, for algorithmic back and forth movement) and springs (for a weighty, physics based feel) are used.

For example, to get the camera tilt, you could use a spring to control the roll of the camera, and apply a force to the spring based on the camera’s horizontal (y axis) rotation speed+direction.

The spring part of this video does a good job demonstrating and explaining what springs can do and how they work:

You should also check out realism, it has a lot of great stuff for what you’re doing and is really easy to use without needing to code additional stuff.

1 Like

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