You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I need help on fixing my viewmodel.
What is the issue? Include screenshots / videos if possible!
Viewmodel completely deleting from the player when game fully loads (~ 3 seconds later)
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
tried changing the scripts, the viewmodel and welds
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
-- this is my main viewmodel script. I used a tutorial to help me make it since it is my first time making.
local RATE_PER_SECOND = 0
local RunService = game:GetService("RunService")
RunService.RenderStepped:Connect(function(step)
local increment = RATE_PER_SECOND * step
script.Parent:WaitForChild("HumanoidRootPart").CFrame = game.Workspace.CurrentCamera.CFrame
end)
RunService.RenderStepped:Connect(function(step)
local increment = RATE_PER_SECOND * step
for index, instance in pairs(script.Parent:GetDescendants()) do
if instance:IsA("BasePart") then
instance.LocalTransparencyModifier = 0
end
end
end)
this script should do the same, put this in StarterPlayerScripts.
make sure you set the viewmodels PrimaryPart to the HumanoidRootPart and put the viewmodel in ReplicatedStorage
local RATE_PER_SECOND = 0
local ReplicatedStorage = game:GetService("ReplicatedStorage") -- getting replicated storage
local RunService = game:GetService("RunService") -- getting runsservice
local Camera = workspace.CurrentCamera
local Viewmodel = ReplicatedStorage.Viewmodel:Clone() -- make sure you put your viewmodel in ReplicatedStorage
RunService.RenderStepped:Connect(function(step)
local increment = RATE_PER_SECOND * step
Viewmodel:SetPrimaryPartCFrame(Camera.CFrame) --Make sure you set your viewmodel PrimaryPart to HumanoidRootPart
Viewmodel.Parent = Camera -- parenting the viewmodel to the camera
for i, instance in pairs(Viewmodel:GetDescendants()) do -- loops through the viewmodel descendants
if instance:IsA("BasePart") then -- check if instance is a basepart
instance.LocalTransparencyModifier = 0
end
end
end)
i ended up changing the script serverside instead of clientside to replicate it on the server aswell, but now when i do this and clone the viewmodel from replicatedstorage i get the same problem again. Could you help me?