Tool Model Disappears/Stops Rendering at certain Camera Angles

I’ve been making my own system that extends off of the basic ROBLOX third person camera that allows you to switch from First Person to Third Person. The Mouse is locked to the centre of the screen, the back only bends in third person.

When the character is in First Person, tools seem to not render when I look at certain angles. I’ve tried using the LocalTransparencyModifier on each MeshPart and CameraMinZoomDistance in StarterPlayer to try and fix the problem however neither have helped.

If I really have to I’m willing to make viewport models for First Person however I was trying to avoid this as I’m a lone developer and was hoping to make a system that allows me to create new guns very quickly.

Here’s a video showing the issue: https://youtu.be/nDYkFPEpB7k

If anyone knows a solution to the problem I would greatly appreciate it!

Thanks in Advance.

1 Like

This is the only solution I’ve come up with in the meanwhile which may end up being permanent is a local script that creates a projection of the gun in the workspace outside of the tool and character model. This means the problem stems from somewhere in those 2 places.

Here’s the code I created to create projections and update them. (Destroying & Recreating projections will make materials go brrrr, so its better to update the CFrame.)

local runService = game:GetService("RunService")

local projectionGroup = Instance.new("Model")
projectionGroup.Parent = workspace.gunProjections

script.Parent.Equipped:Connect(function(mouse)
	active = true
	for cPos, child in pairs(script.Parent:GetChildren()) do
		if child:IsA("MeshPart") or child:IsA("Part") or child:IsA("SpecialMesh") then
			child.Transparency = 1
		end
	end

	for cPos, child in pairs(script.Parent:GetChildren()) do
		if child:IsA("MeshPart") or child:IsA("Part") or child:IsA("SpecialMesh") then
			if child.Name ~= "Handle" then
				local newProjection = child:Clone()
				newProjection.Parent = projectionGroup
				newProjection.Transparency = 0
			end
		end
	end
end)

script.Parent.Unequipped:Connect(function(mouse)
	active = false
	for cPos, child in pairs(projectionGroup:GetChildren()) do
		if child:IsA("MeshPart") or child:IsA("Part") or child:IsA("SpecialMesh") then
			child:Destroy()
		end
	end
	for cPos, child in pairs(script.Parent:GetChildren()) do
		if child:IsA("MeshPart") or child:IsA("Part") or child:IsA("SpecialMesh") then
			if child.Name ~= "Handle" then
				child.Transparency = 0
			end
		end
	end
end)

runService.RenderStepped:Connect(function(delta)
	if active then
		for cPos, child in pairs(projectionGroup:GetChildren()) do
			if child:IsA("MeshPart") or child:IsA("Part") or child:IsA("SpecialMesh") then
				child.CFrame = script.Parent:FindFirstChild(child.Name).CFrame
			end
		end
	end
end)
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.