-
What do you want to achieve? Im trying to make it so when the player’s character is the near the part. it shakes the screen, i am using EZ camera shaker
-
What is the issue? It doesnt work. ive tried using some stuff from the module instructions but no luck.
-
What solutions have you tried so far? Ive looked everywhere on the devfourms. cant seem to find a solution.
local CameraShaker = require(game:GetService('ReplicatedStorage'):WaitForChild("CameraShaker"));
local camera = workspace.CurrentCamera
local camShake = CameraShaker.new(Enum.RenderPriority.Camera.Value, function(shakeCf)
camera.CFrame = camera.CFrame * shakeCf
end)
game.Players.PlayerAdded:Connect(function(player)
local character = player.Character or player.CharacterAdded:Wait()
while wait() do
camShake:Start()
local shake = camShake:Shake(CameraShaker.Presets.Explosion)
local part = workspace.Part
local distance = (character.Head.Position - part.Position)
shake:SetScaleMagnitude(distance/10)
end
end)
(Sorry if the code is messy)