i was working on camera shake, well, trying to work on camera shake, there was no errors in the script, but says “attempt to perform arithmetic (mul) on nil and number” in the output, i was confused that what the hell causes the error?
b = (workspace.Camera.CFrame) * CFrame.Angles(0, 0, math.rad((math.random(-game.Workspace.Sound.PlaybackLoudness, workspace.Sound.PlaybackLoudness)) * workspace.Sound))
local hgf = (game.TweenService:Create(workspace.Camera, TweenInfo.new(0.15, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0, false, 0), {
CFrame = game.TweenService + Vector3.new(math.rad((math.random((-workspace.Sound.PlaybackLoudness) * 0.05, (workspace.Sound.PlaybackLoudness) * 0.05)) * 0.05), math.rad((math.random((-workspace.Sound.PlaybackLoudness) * 0.05, (workspace.Sound.PlaybackLoudness) * 0.05)) * 0.05), math.rad((math.random((-workspace.Sound.PlaybackLoudness) * 0.05, (workspace.Sound.PlaybackLoudness) * 0.05)) * 0.05))
})):Play()
local amount = workspace.Sound:FindFirstChild("Value")
if amount then
amount= workspace.Sound.PlaybackLoudness
if amount > workspace.Sound:WaitForChild("Value").Value then
return
end
end
yep, its a poorly scripted camera shake i guess, i dont know nothing about camera shake, this is actually my first time scripting the camera shake.
Just going to toss in this LINK here is to one of the best camera shaking systems I’ve seen yet. I’ve even used this one in Unity (where it came from).