Hey,
I’m trying to make a viewmodel weapon model for the first time however im having this issue where if i looked down, the character would collide with some part of the viewmodel even though everything inside the viewmodel is cancollide off
The code looks like this
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local camera = game.Workspace.CurrentCamera
local framework = {
inventory = {
"PistolTest";
};
viewmodel = nil;
}
function loadSlot(Item)
local viewmodelFolder = game.ReplicatedStorage.Viewmodels
if viewmodelFolder:FindFirstChild(Item) then
framework.viewmodel = viewmodelFolder:FindFirstChild(Item):Clone()
framework.viewmodel.Parent = camera
local Animator:Animator = framework.viewmodel.Humanoid.Animator
local idleanim = Animator:LoadAnimation(framework.viewmodel.Animations.Anim_Idle)
idleanim.Looped = true
idleanim:Play()
end
end
RunService.RenderStepped:Connect(function()
for i, v in pairs(camera:GetChildren()) do
if v:IsA("Model") then
v:SetPrimaryPartCFrame(camera.CFrame)
end
end
end)
loadSlot(framework.inventory[1])
I tried to remove the humanoid and didnt have this issue, however i need the humanoid to display clothing for arms, animations, bevels etc. Deleting the humanoid doesnt look like an option
I also tried enabling PlatformStand on viewmodel humanoid however it wasnt any help
Thanks!