Can you provide you’re code being used in the ViewPortFrame. (Also by any chance is the model in the viewport very far away from the world centre as that causes these sorts of errors)
local ply = game.Players.LocalPlayer
repeat wait() until ply.Character ~= nil
local character = ply.Character
local root = character:WaitForChild("HumanoidRootPart")
local playergui = ply:WaitForChild("PlayerGui")
local healthgui = playergui:WaitForChild("HealthGui")
local visual = healthgui:WaitForChild("visual")
local viewportframe = visual:WaitForChild("ViewportFrame")
local runservice = game:GetService("RunService")
local tweenservice = game:GetService("TweenService")
local tween = tweenservice:Create(viewportframe, TweenInfo.new(3, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut), {ImageTransparency = 0})
tween:Play()
local camera = Instance.new("Camera")
local clonedchar = nil
viewportframe.CurrentCamera = camera
ply.CharacterAdded:Connect(function(ncharacter)
root = ncharacter:WaitForChild("HumanoidRootPart")
character = ncharacter
viewportframe.ImageTransparency = 1
tween:Play()
end)
runservice.RenderStepped:Connect(function()
if character ~= nil then
if clonedchar ~= nil then
clonedchar:Destroy()
end
local model = Instance.new("Model", viewportframe)
local children = character:GetChildren()
for _, child in pairs(children) do
if not child:IsA('LocalScript') and not child:IsA('Script') and not child:IsA("Folder") then
if child:IsA("Humanoid") then
child.DisplayDistanceType = "None"
end
local clone = child:Clone()
if child:IsA('BasePart') then
clone.CanCollide = false
elseif child:IsA("Accessory") or child:IsA("Tool") then
for _, descend in pairs(clone:GetDescendants()) do
if descend:IsA("Sound") or descend:IsA("Script") or descend:IsA("LocalScript") then
descend:Destroy()
end
end
end
clone.Parent = model
end
end
clonedchar = model
camera.CFrame = CFrame.new((root.CFrame.LookVector * 9)+(root.CFrame.RightVector * 4)+root.Position,root.Position)
end
end)
and in the explorer it looks like this:
the script is called “status bar”, and the character view is in viewport frame
ignore the tween stuff and healthgui is parented to startergui
it depends on where the character is, if the character’s position is 4, 0, 0 then the viewmodel character’s position will be 4, 0, 0, the camera just points to the character’s head
edit: just realized the map is really far from 0, 0, 0
Yeah, when the character is a few hundred thousand studs away from 0,0,0 then it can start glitching out like this, how far away was the screenshot above taken?
In that case it should be a problem with the distance, are you rendering the full map in the viewport, if so that could be putting to much pressure on the viewport.