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
- 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.