Hi, I’m @shieldmr3, I’m a scripter and a game developer. I’m the current scripter for an upcoming scary game “Geisha”.
I was making a jumpscare script and wanted to add a bit of a camera shake, I tried many things but they all don’t seem to work while running the function, otherwise they work perfectly fine. Here’s my script:
game.ReplicatedStorage.Jumpscares.OnClientEvent:Connect(function(monster)
for i, v in pairs(game.ReplicatedStorage.JumpScareSettings:GetChildren()) do
if v then
if v.Name == monster then
if not Done then
Done = true
local Settings = v
local MainModel = workspace:FindFirstChild(v.Name.."JumpscareRoom")
local Dummy = MainModel:FindFirstChild(monster.."JumpscareDummy")
local CamPart = MainModel:FindFirstChild("JumpscareCam")
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CFrame = CamPart.CFrame
local Animation = Settings.JumpscareAnim
local Time = Animation:WaitForChild("Time")
local Audio = Settings.JumpscareAudio
local Anim = Dummy.Humanoid:LoadAnimation(Animation)
Anim:Play()
Audio:Play()
wait(Time.Value)
Camera.CameraType = Enum.CameraType.Custom
game.ReplicatedStorage.RespawnController:FireServer()
wait(0.8)
Camera.CameraType = Enum.CameraType.Custom
Anim:Stop()
Audio:Stop()
Done = false
end
end
end
end
end)
And I tried adding something like this in a for loop:
Humanoid.CameraOffset = Vector3.new(randomX, randomY, randomZ)
Also tried:
Camera.CFrame = Camera.CFrame + Vector3.new(randomX, randomY, randomZ)
But all of them don’t seem to work, would really appreciate it if you can help!
Thanks,
@shieldmr3