game.ReplicatedStorage.RemoteEvents.BlackoutEvent.OnClientEvent:Connect(function(GoingIntoRoom , CameraType)
local randomangle = math.random(-8,8) * 45
local TweenService = game:GetService("TweenService")
local PartProperties = {BackgroundTransparency = 0}
local TweenInfov = TweenInfo.new(
0.32,
Enum.EasingStyle.Linear,--EasingStyle
Enum.EasingDirection.Out,--Easing direction
0,--times to repeat
false,--goes in reverse
0--delay
)
local Tween = TweenService:Create(script.Parent,TweenInfov,{BackgroundTransparency = 0})
Tween:Play()
Tween.Completed:Wait()
if GoingIntoRoom == true then
game.Lighting.Atmosphere.Haze = 10
else
game.Lighting.Atmosphere.Haze = 0
end
print(CameraType)
game.Workspace.CurrentCamera.CameraType = Enum.CameraType[CameraType]
local Tween = TweenService:Create(script.Parent,TweenInfov,{BackgroundTransparency = 1})
Tween:Play()
end)
I have a local script that changes the camera type, the problem is that despite it actually changing the camera type on workspace.CurrentCamera, the camera doesn’t change.
I dont think so, because the value does change properly, its just that the camera doesn´t stay in one position if the value of the string is “fixed”
I do have another script though, so it might be doing something
--Get service needed for events used in this script
local RunService = game:GetService("RunService")
-- Variables for the camera and player
local camera = workspace.CurrentCamera
local player = game.Players.LocalPlayer
player.CharacterAdded:Wait()
-- Constant variable used to set the camera’s offset from the player
local CAMERA_OFFSET = player.Character:WaitForChild("CameraOffset").Value
print(CAMERA_OFFSET)
camera.CameraType = Enum.CameraType.Scriptable
local function onRenderStep()
-- Check the player's character has spawned
if player.Character then
local CAMERA_OFFSET = player.Character:WaitForChild("CameraOffset").Value
local playerPosition = player.Character.HumanoidRootPart.Position
local cameraPosition = playerPosition + CAMERA_OFFSET
-- make the camera follow the player
camera.CoordinateFrame = CFrame.new(cameraPosition, playerPosition)
end
end
RunService:BindToRenderStep("Camera", Enum.RenderPriority.Camera.Value, onRenderStep)
Ok I tried it, it worked just the same, but the camera still acts as if its being scripted, Maybe it’s because of the :BindToRenderStep that causes the camera to stil behave as if it was scriptable type.
Also I just realised that copying and pasting my code somewhere else really helps me for some reason
Hm, maybe just put the BindAction() function out to see if it makes any difference? I don’t think that’d be the case, another instance that I see is that you didn’t really change the CurrentCamera’s CFrame to a certain location on the OnClientEvent?