Well, I have run into a major issue, consisting of the fact that all of my character’s parts and meshes making it up simply dissapear.
This causes the camera to wig out when I die, making it a very annoying experience to debug my other scripts when I can’t focus on something for over 5 seconds.
This issue only happens on the client, and I have figured out that disabling the following script will cause it to work again:
--Services
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
--get mouse
local player = Players.LocalPlayer
local mouse = player:GetMouse()
local cameraStartPos = workspace.CameraStart.Position
local camera = workspace.CurrentCamera
--Easy camera manipulation
repeat
wait()
camera.CameraType = Enum.CameraType.Scriptable
until camera.CameraType == Enum.CameraType.Scriptable
--Set cframe to starter pos
camera.CFrame = CFrame.new(cameraStartPos, cameraStartPos + Vector3.new(0, -1.2, 0))
RunService.Stepped:Connect(function()
--Convert mouse position to a value between 0 and 1
local mouseVector = Vector2.new(mouse.X, mouse.Y)
local viewportVector = Vector2.new(camera.ViewportSize.X, camera.ViewportSize.Y)
local mouseScale = mouseVector / viewportVector
if mouseScale.Y < 0.1 then
--If mouse is on the bottom side
camera.CFrame = camera.CFrame + Vector3.new(1,0,0)
elseif mouseScale.Y > 0.9 then
--If mouse is on the bottom side
camera.CFrame = camera.CFrame + Vector3.new(-1,0,0)
elseif mouseScale.X < 0.1 then
--If the mouse is on the left side
camera.CFrame = camera.CFrame + Vector3.new(0,0,-1)
elseif mouseScale.X > 0.9 then
--If the mouse is on the right side
camera.CFrame = camera.CFrame + Vector3.new(0,0,1)
end
end)
Thanks!