Camera effect like criminality

So i saw this If We Are Recognized In Roblox Criminality, The Video Ends (2K SUB SPECIAL) - YouTube
It’s a walking and running effect that the game called criminality uses and i would like to do that too but i don’t know how to do it since i’m new to programming even tho i know all the basics.I searched for similar tutorials found things but they’re just not the same as the camera that a showed you earlier i really want to add that effect to my game and i hope someone could help (pls include code with explanation if possible).
Thanks in advance!

4 Likes

You would essentially use a cframe lerped function inside a render step function, and then implement that cframe that you lerped into the camera’s cframe. if it’s a bit confusing, here’s sort of what I mean

local camerabobcf = CFrame.new()
local cam = workspace.CurrentCamera

game:GetService("RunService").RenderStepped:Connect(function()
    cam.CFrame = cam.CFrame
    * camerabobcf

    camerabobcf = camerabobcf:Lerp(CFrame.new() * CFrame.Angles(
        0,
        0, 
        0.002 * math.sin(tick() * 3)) -- intensity * math.sin(tick() * speed))
        ,.1)
    

end)

-- you could check if the player is running and make the render step work when the variable is true or something

That should produce an effect similar to the one you posted. I’m not sure if the rotation is on the right axis but a bit of tinkering around should fix it. If you have any questions about it then do reply to this message.

2 Likes

Ok thx i’ll tinker around with the script and see what i can do.And thx again this will be rlly helpful to my game!

1 Like

Hey i just got a question how would i make it so when the player moves it does it?

This is slightly modified from free script came from toolbox (for me because i felt familiar with one script I’ve been using before) and it’s called View Bobbing

applies to FE Gun kit but since they also use FE Gun kit (this is no where to be confirmed if they uses Latest version but I’m sure it’s a big no)
it’s modified and they added a script which is for “LocalScript”
ViewBobbing also uses spring to calculate bouncy and elastic for that too

so that script comes with fe gun kit or…?

it is not likely
as i said before “This is slightly modified from free script” it is not confirmed that it is but since the game created is older before the releases of view bobbing added for non viewmodel version although the view bobbing from fe gun kit has no rotation settings so that’s still a big no cuz that’s not how the view bobbing in official version works

ok then i’ll use what @iceking_gfx said.

You should use a Humanoid.Running event and then adjust a running variable as so.

Like this:

local plr = game.Players.LocalPlayer
local char = plr.Character
local hum = char:WaitForChild("Humanoid")

local running = false

local camerabobcf = CFrame.new()
local cam = workspace.CurrentCamera

game:GetService("RunService").RenderStepped:Connect(function()
    cam.CFrame = cam.CFrame
    * camerabobcf

    if running then
        camerabobcf = camerabobcf:Lerp(CFrame.new() * CFrame.Angles(
            0,
            0, 
            0.002 * math.sin(tick() * 3)) -- intensity * math.sin(tick() * speed))
            ,.1)
    else
        camerabobcf = camerabobcf:Lerp(CFrame.new(),.1)
    end
end)


hum.Running:Connect(function(speed)
    if speed > 0.1 then
        running = true
    else
        running = false
end)
2 Likes

Ok thanks i’ll mark this as the solution instead!