When changing the CFrame CurrentCamera starts jitter

I apologize in advance, I am not a native English speaker and use a translator.
I tried to change CameraType, but it didn’t help, I would really like to find a solution

--\/ 

if not game.Loaded then
    
    game.Loaded:Wait();
    
end

--// Main setup

--| Service's;

local PlayersService = game:GetService("Players");
local RunService      = game:GetService("RunService");

--| Variable's

local LocalPlayer    = PlayersService.LocalPlayer;

LocalPlayer.CharacterAdded:Wait();

local Character      = PlayersService.LocalPlayer.Character;
local Humanoid       = Character:WaitForChild("Humanoid");

local CurrectCamera  = workspace.CurrentCamera;

--// Main

local function Stepped(delta: number)
    
    local standingz = math.sin(tick() * 10) / 45;
    
    CurrectCamera.CFrame *= CFrame.Angles(0, 0, standingz);
    
end

--// Callback's;

RunService.RenderStepped:Connect(Stepped);

Look at the bottom of the screen

4 Likes

Sorry i didn’t understand your issue at first place

Try To Use RunService:BindToRenderStep()
https://create.roblox.com/docs/reference/engine/classes/RunService

1 Like

I tried , but it didn’t help(
RunService:BindToRenderStep(“Before cam”, Enum.RenderPriority.Camera.Value - 1, Stepped)

I can see now you need to use math.rad when you useing CFrame.Angles()
code ex :

local function Stepped(delta: number)
    
    local standingz = math.sin(tick() * 10) / 45;
    
    CurrectCamera.CFrame *= CFrame.Angles(0, 0, math.rad(standingz));
    
end

No, unfortunately it didn’t help.

1 Like

Can you describe what’s the problem exactly and what you try to achieve?

I want to do manipulations with the camera, by the type of swaying when walking, etc. And the problem is visible on the video, objects seem to shift

I’m not sure as to what you want. It’s expected behavior based on the code that you currently have.

math.sin(tick() * l) / d

-- let l be speed of sine wave
-- let d be damper of sine wave

If you don’t want it to look like your eyes are playing tricks on you, decrease d (45 in your code) by a bit. This should make the wobble more visible.

Yes, but the video I attached shows that the objects seem to be shifting, I need to fix it
(Look at the bottom of the screen on video)

1 Like

Doesn’t happen to me, how are you sure this isn’t just a hardware issue?

About this, I asked 1 person to help me look at it, he had the same thing, but when I wrote to the Russian-language forum, the person replied to me that this was not happening with him.

I saw on the video, you have exactly the same displacement effect

Are you sure your camera type is Scriptable/Fixed? If not, you should set it like so to prevent Roblox’s CameraModule from interfering with it.

The camera type is Fixed, but if I use Scriptable, then the camera detaches from the character

Very weird. Try changing the camera mode to attach and see what happens. Does it still jitter or only move vertically?

Camera still jitter and I don’t really understand what you mean under move vertically

Sounds like a bug then unless another script or free model is messing with the camera.

I tested it on a clean map, it’s still the same

This could possibly be a hardware issue. Try running this and disable your third party programs, possibly by using “Safe mode with networking” in the Windows Boot Manager menu. On mac, you can try single user mode.

Edit: what is the position of the part you are viewing with the camera?

Part position? Camera position attacment to default character position