Serious problem!

I want to use the Ez shake module( EZ Camera Shake ported to Roblox ) to create screen shaking during explosions. I have connected this module. But the problem is that I have a local script for smoothly rotating the camera. It overrides the shaking animation and does not allow it to work normally. By turning off the smooth rotation script, the shaking works as it should. But once you turn this script back on, there is no shaking anymore.


– Rotation script

– Shake script

How can this be fixed? disabling the script of smooth rotation at the time of the explosion is not very good, since the camera position is still set there in relation to the character, and the shutdown will be very noticeable

1 Like

There is a much simpiler camera shake script if you would like that

local script inside starterpack

local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
local Time = 5
local Starttime = tick()
repeat 

	wait()

	local endtime = tick()
	local xoffset = math.random(-100,100) / 500 --the lower the more shaky the higher the less shaky
	local yoffset = math.random(-100,100) / 500 --the lower the more shaky the higher the less shaky
	local zoffset = math.random(-100,100) / 500 --the lower the more shaky the higher the less shaky
	hum.CameraOffset = Vector3.new(xoffset,yoffset,zoffset)

	hum.CameraOffset = Vector3.new(xoffset,yoffset,zoffset)

until endtime - Starttime >= Time
hum.CameraOffset = Vector3.new(0,0,0)

sample of camera shake

its not worked.
Smooth rotation script overrides the shaking animation and does not allow it to work

1 Like

so i actually had the same exact problem and fixed it using renderpriority + Bindtorenderstep

for your camera script, bind it to renderstep like this: runService:BindToRenderStep("Update camera", Enum.RenderPriority.Last.Value, updateCamera)

and for the camera shake:

local camShake = CameraShaker.new(Enum.RenderPriority.First.Value, function(shakeCf)
	Camera.CFrame = Camera.CFrame * shakeCf
end)

dont work(
Camera script -

Camera Shaker -

well is “shakeEvent” even firing? add a print statement in on OnClientEvent, and the if statement may be messing with it, try removing the if and see if it works

Yeah, Event work perfectly, print work

put a print in the if shaketype == explosion and tell me if it prints, otherwise your Context:BindAction may be messing with it

well then maybe in the BindAction in your camera script, otherwise i don’t really know

I cut out BindAction, but it didn’t help either, I don’t understand what’s the matter :smiling_face_with_tear:

Does no one really know how to fix it? :thinking: :face_with_monocle:

Who can help???
Problem still here!..

Here is an example of Camera shaker that I use, you might find your solution here :slight_smile: :

StarterPlayer>StarterCharacterScripts>(Localscript)ShakeEffect :

local CameraShaker = require(game.ReplicatedStorage.Modules.CameraShaker)

local camera = game.Workspace.CurrentCamera

local plr = game.Players.LocalPlayer

local centerPart = game.Workspace.SixEightTwo.HumanoidRootPart
local distanceToPart = 50


local camShake = CameraShaker.new(Enum.RenderPriority.Camera.Value, function(shakeCFrame)
	camera.CFrame = camera.CFrame * shakeCFrame
end)

camShake:Start()

-- Explosion shake:

game.ReplicatedStorage.Remotes.Shake.OnClientEvent:Connect(function()
	if (camera.CFrame.Position - centerPart.CFrame.Position).Magnitude < distanceToPart then
		camShake:Shake(CameraShaker.Presets.Explosion)
	end
		
		
	
	
	
end)

From the sender (server script) :

game.ReplicatedStorage.Remotes.Shake:FireAllClients()

I hope it helps you.