Hi, this script isn’t working and I can’t figure out why. Basically it makes the camera shake if your camera is close enough to an explosion. This works, but I only want it to shake for certain explosions. A value is added and named “NoSHK” to indicate that the screen should not shake, however it is still shaking with these explosions for some reason!
game.Workspace.DescendantAdded:connect(function(Thing)
if Thing.ClassName == "Explosion" and Thing.Visible == true then
if (Thing.Position - game.Workspace.CurrentCamera.CFrame.Position).magnitude < 85 then
if not Thing:FindFirstChild("NoSHK") then
camerashake(Thing)
end
end
end
end)
game.Workspace.DescendantAdded:connect(function(Thing)
if Thing.ClassName == "Explosion" and Thing.Visible == true then
if (Thing.Position - game.Workspace.CurrentCamera.CFrame.Position).magnitude < 85 then
if not Thing:GetAttribute("NoSHK") then
camerashake(Thing)
end
end
end
end)
here’s a video of the issue. The screen shouldn’t be shaking still! Also sadly the attribute didn’t work. I’m checking the explosion in workspace and the value is there
Just to check something - can you please comment out the camerashake(Thing) line in the code?
Does it stop the shaking entirely for all explosions, or do the explosions still cause shaking?
stops it entirely. That’s the function for the camera shaking. I think the issue may be that the value is added like a millisecond too late or something
Ahh my mistake. The whole time I was editing a similar attack with an explosion. The reason it was still shaking was because I was not editing the attack I was testing. The attribute method worked fine!
I suspected that something must have been happening that wasn’t affected by the script changes you were making, hence why I had you test commenting out various lines xD