The title, I have a viewmodel rig that contains a base part that is constantly set to the cameras CFrame on the client, and the other parts will be re-positioned with their respective offsets from the base part, here is the code and some images that help explain the situation:
game["Run Service"].RenderStepped:Connect(function()
script.Parent.Viewmodel:SetPrimaryPartCFrame(game.Workspace.CurrentCamera.CFrame)
for i,v in pairs(script.Parent.Viewmodel:GetChildren()) do
if v:IsA("Part") then
v.LocalTransparencyModifier = 0
end
end
end)
As you can see from the gif provided, the viewmodel seems to randomly become invisible, I made sure it wasnt because of some random spikes in position changes, all parts seem to still be there, just not visible, backing this up is the shadows, they cast in their expected spot even when the parts are invisible, any guesses as to why this happens?
Fairly certain SetPrimaryPartCFrame will auto-update other parts in a model while setting the CFrame directly wont, but I could try that to see if that is still true. Either way, might not be the most obvious solution, I feel the solution to the issue at hand would be a bit more obvious than how I apply my CFrames, because at the end of the day the position would be the same.
Forgot to mention they are rigged with Motor6Ds, the welds in the picture were byproducts of the quick rigging plugin I was using, deleting them did not fix the problem however.
So I just moved the base part back and it suddenly works, I guess the parts just randomly got exactly enough out of view to cull at specific angles??? This is such a strange bug, if anybody eventually finds an actual solution, please post it here (if possible), but for now this is what helped me.