So the title says it all. I’ve fixed my camera script problem, but now I have another problem with this script:
(Sorry for the bugginess and lack of detail )
as you can see, when I step on the invisible part, the camera zooms in, but then suddenly zooms back out.
Here’s the Camera script:
local player = game.Players.LocalPlayer
local camera = workspace.CurrentCamera
player.CharacterAdded:Wait()
player.Character:WaitForChild("HumanoidRootPart")
camera.CameraSubject = player.Character.HumanoidRootPart
camera.CameraType = Enum.CameraType.Attach
camera.FieldOfView = 40
game:GetService("RunService").Stepped:Connect(function()
camera.CFrame = CFrame.new(player.Character.HumanoidRootPart.Position) * CFrame.new(0,5,45)
end)
and here’s the Camera Change script(The script that changes the camera):
local RmtEvent = game.ReplicatedStorage.Room1
local Camera = workspace.CurrentCamera
local Object = game.Workspace.Room1.Observe
local Player = game.Players.LocalPlayer
repeat wait() until Player.Character
local TS = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut)
local Properties = {CFrame = Object.CFrame}
local Tween = TS:Create(Camera, tweenInfo, Properties)
RmtEvent.OnClientEvent:Connect(function()
Camera.CameraType = Enum.CameraType.Scriptable
wait(0.2)
Camera.CameraSubject = Object
Tween:Play()
print("Yay! :D")
end)
Are there any mistakes I’ve placed? Let me know!