Character body parts disappearing?

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!

2 Likes

I am not entirely sure but I believe this has something to do with your RunService function, you might want to change that around until it works again. I really hope this helps (:

Happy Holidays! :christmas_tree:

1 Like

Good news! Shortly after this, Roblox began saying I couldn’t save, and forced me to discard my changes, so I copied my written code onto notepad, but then I couldn’t save because all of my keys all of a sudden were bonded to an action, so yeah, I had a fun time getting that fixed.

I actually remember before logging out of all sessions, so this might have had something to do the glitch. Tomorrow, I will test if it works and I will either delete this post or mark this as solved.

1 Like

Yay! I hope it all works out, sorry you had to go through that.