You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I want it so once the jumpscare is completed, i want the camera type to go back to custom
-
What is the issue? Include screenshots / videos if possible!
it seems to be that there is a 50% chance of it actually returning to custom, the other 50% it just says on custom and gets stuck on the jumpscare
local player = game.Players.LocalPlayer
local character = player.Character
local humanoid = character:WaitForChild("Humanoid")
local playerDeath = game.ReplicatedStorage.Remotes:WaitForChild("playerDeath")
local camera = workspace.CurrentCamera
local function deathEffect()
camera.CameraType = Enum.CameraType.Scriptable
local headview = camera.CFrame
camera.CFrame = game.Workspace.Jumpscare.Body.Body.deathCam.CFrame
wait(3)
camera.CameraType = Enum.CameraType.Custom
end
humanoid.Died:Connect(deathEffect)
humanoid.Died:Connect(function()
wait(0.8)
game.Workspace.Jumpscare.Body.Body["Sword Hit stab 5 beyond x OTH"]:Play()
local TweenService = game:GetService("TweenService")
local deathFade = TweenService:Create(script.Parent, TweenInfo.new(1), {BackgroundTransparency = 0})
deathFade:Play()
end)
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.
After turning CameraType back to Custom set the camera’s CFrame back to the character’s HumanoidRootPart CFrame
Thank you so much, i honestly dont know how i didnt see that
1 Like
hey uhm… it happened again but at this point i have no clue
Try to set the camera’s CameraSubject and Focus to the player as well?
camera.CameraSubject = character.Humanoid
camera.Focus = character.HumanoidRootPart.CFrame
It should work unless the script broke somewhere
it still gets stuck on the jumpscare
1 Like
Did you change anything in your code? Or is it still the same? Also what does headview do in the death function
didnt change anything, headview was just shortening camera.CFrame but i didnt end up using it
Try creating a part that faces the jumpscare guy, when deathEffect function is triggered change the camera subject to that part. After it’s complete change the camera subject to player.Character. I use parts instead of setting CFrame , it feels less confusing.
Also mind sending any output messages related to the problem
havent tried what you said yet but there is no output issues
1 Like
changing the camera subject to the part makes it do nothing ( no outputs either)
local player = game.Players.LocalPlayer
local character = player.Character
local humanoid = character:WaitForChild(“Humanoid”)
local playerDeath = game.ReplicatedStorage.Remotes:WaitForChild(“playerDeath”)
local camera = workspace.CurrentCamera
local function deathEffect()
camera.CameraType = Enum.CameraType.Scriptable
camera.CameraSubject = game.Workspace.Jumpscare.Body.Body.deathCam
wait(3)
camera.CameraType = Enum.CameraType.Custom
camera.CameraSubject = player.Character.HumanoidRootPart
camera.CameraSubject = character.Humanoid
camera.Focus = character.HumanoidRootPart.CFrame
end
humanoid.Died:Connect(deathEffect)
humanoid.Died:Connect(function()
wait(0.8)
game.Workspace.Jumpscare.Body.Body[“Sword Hit stab 5 beyond x OTH”]:Play()
local TweenService = game:GetService(“TweenService”)
local deathFade = TweenService:Create(script.Parent, TweenInfo.new(1), {BackgroundTransparency = 0})
deathFade:Play()
end)
add a print below the deathEffect to make sure if it’s executed.
also set the cameraSubject to the character(the model one) not the humanoid root part.
And “camera.CameraType = Enum.CameraType.Custom” , “fixed” is the default property.
one question: why do you use the camera.focus ? I don’t think it’s necessary
i used camera focus bc the other dude recommended it
well , I wouldn’t use it since you’re already changing the camera subject. It doesn’t do much
1 Like
making the camera type fixed just made the camera stay mid air and the camera wont change to the part
1 Like
add prints everywhere to debug , you need to do debugging to solve problems.
1 Like
ill do that in the morning bc its 2:36 am for me rn
1 Like