So I want to make a viewModel for a first person horror game, so when you look down, you see your body. I followed a dev forum by EgoMoose here; Before I thought I had fixed the problem by realizing that I forgot to parent the viewmodel clone but that was not the problem. Here is my code currently.
local camera = game.Workspace.CurrentCamera;
local humanoid = game.Players.LocalPlayer.CharacterAdded:Wait():WaitForChild("Humanoid");
local viewModel = game.ReplicatedStorage:WaitForChild("viewModel"):Clone();
viewModel.Parent = camera
local function onDied()
viewModel.Parent = nil;
end
local function onUpdate(dt)
viewModel.Head.CFrame = camera.CFrame;
end
humanoid.Died:Connect(onDied);
game:GetService("RunService").RenderStepped:Connect(onUpdate)
I don't get any errors, and I don't know what to do. Please provide input. I think the problem might be that the tutorial given by EgoMoose is intended to be used with a gun, but I don't know how I would change it to be what I want it to be.
Issue: Nothing happens, when I look down I see nothing I have checked every part in the model, and everything's transparency is 0.
Steps Taken: I have tried changing the parent of the model to Workspace, Camera, and PlayerGui but none have worked. I don't know what else to do other than that.
Edit: I apologize for not including this in the original question, but I do have LockFirstPerson on.

1 comment
bump