im making my first inventory system and i wanted to make the part do like 360 as a viewing,
the problem is that it keeps giving me errors as there is no primary part in the model and i tried to make the script wait for the model to load but still it gives nil the first time then it does it correctly.
local viewportframe = script.Parent
viewportframe.ChildAdded:Connect(function(child)
if child:IsA("Model") then
while task.wait(0.001) do
if viewportframe:FindFirstChildWhichIsA("Model") then
child.PrimaryPart.CFrame *= CFrame.Angles(0,0.05,0)
end
end
end
end)
Just click on the Model and in the Properties click on “PrimaryPart”. You can now select a Part in the model from the Workspace window, or you can Alt left click on the model in the viewport window to select a Part there.
This sets the PrimaryPart.