[Help Wanted] - The camera moving with character when camera shake

You can write your topic however you want, but you need to answer these questions:
1.So what i want, i just want my character stop rotation when the camera start shaking

2.my issue its every time the camera start shaking my character start rotation and that so annoying for player i tried fix it so many times and i don’t know what best why to fix it

  1. I tried to look at some of the scripts that are similar to what I want, but they are the same. Some of them are the camera does not shake, and some of them the character moves with it. I tried to make one myself, but it did not what i want, my character moved with the camera player.

[Example Lua]

local RunService = game:GetService("RunService")
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
task.wait(1) -- Cooldown


character .Humanoid.CameraOffset = Vector3.new(0, 0, -1)
for i, v in pairs(character :GetChildren()) do
	if v:IsA("BasePart") and v.Name ~= "Head" then
		v:GetPropertyChangedSignal("LocalTransparencyModifier"):Connect(function()
			v.LocalTransparencyModifier = v.Transparency
		end)
		v.LocalTransparencyModifier = v.Transparency
	end
end

local HeadPs = character.Head.Position.Y

RunService.RenderStepped:Connect(function(deltaTime)

	local ray = Ray.new(character.Head.Position, ((character.Head.CFrame + character.Head.CFrame.LookVector * 2) - character.Head.Position).Position.Unit)
	local ignoreList = character:GetChildren()
	local hit, pos = game.Workspace:FindPartOnRayWithIgnoreList(ray, ignoreList)
	if hit then -- when player hit walls
		character.Humanoid.CameraOffset = Vector3.new(0, .5, -(character.Head.Position - pos).magnitude)
	else
		character.Humanoid.CameraOffset = Vector3.new(0, -(character.Head.Position.Y - HeadPs)+.2, -1.5)
	end
end)

[Example Video]


Can someone help me with it?

Please Ignore The lag in the video.

And Thank you.

Is the character constantly looking at the camera using a script? i think that may be the problem if i’m correct

yeah it’s loop and there no objects or values makes the loop stopped.

try using this instead to make the character face the camera

local gamesettings = UserSettings().GameSettings
gamesettings.RotationType = Enum.RotationType.CameraRelative
1 Like

still same thing happend the character rotation every shaking :<

hmm, try this…

local Character = script.Parent
local Humanoid = Character.Humanoid
local Camera = workspace.CurrentCamera
local Root = Character.HumanoidRootPart

game:GetService("RunService").RenderStepped:Connect(function()

local CamOffset = Humanoid.CameraOffset
local CamCF = Camera.CFrame * CFrame.new(CamOffset.X,0,0)

Root.CFrame = CFrame.new(Root.Position,Root.Position+CamCF.CFrame.LookVector*5000)

end)

If it don’t work try

local Character = script.Parent
local Humanoid = Character.Humanoid
local Camera = workspace.CurrentCamera
local Root = Character.HumanoidRootPart

game:GetService("RunService").RenderStepped:Connect(function()

local CamOffset = Humanoid.CameraOffset
local CamCF = Camera.CFrame * CFrame.new(-CamOffset.X,0,0)

Root.CFrame = CFrame.new(Root.Position,Root.Position+CamCF.CFrame.LookVector*5000)

end)
1 Like

after i checked roblox first person it’s was from shaking script not from first person script ty for help me

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