Viewmodel is pushing the character [SOLVED]

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve?

I want to use a viewmodel, I’ve parented it to the camera.

  1. What is the issue?

The viewmodel is pushing the character, I assume you’ve seen a similiar topic like this before.

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

Yes, I did. First I disabled collisiongroups myself. Then I searched on the devforum for any similiar questions. Found a similiar topic, the solution was literally the thing I did myself.

Just in case I did something wrong, here’s a screenshot:

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!

local Cam = workspace.CurrentCamera
local ViewModel = game.ReplicatedStorage:WaitForChild("ViewModel"):Clone()
ViewModel.Parent = Cam
local Player = game.Players.LocalPlayer
local Character = script.Parent
local Camera = workspace.CurrentCamera
local RunService = game:GetService("RunService")
 
local ViewModel = game.ReplicatedStorage.ViewModel:Clone()
ViewModel.Parent = Camera
 
RunService.RenderStepped:Connect(function()
	if Player.Character.Humanoid.Health == 0 then
		if Camera:FindFirstChild("ViewModel") ~= nil then
			Camera.ViewModel:Destroy()
		end
	end
 
	if Camera:FindFirstChild("ViewModel") ~= nil then
		Camera.ViewModel:SetPrimaryPartCFrame(Camera.CFrame * CFrame.new(.025, -1.5, -1))
	end
end)

Any help is much appreciated.

2 Likes

Oh yeah by the way the viewmodel was from the toolbox but I think it’s fine to be honest.

1 Like

did you try moving the viewmodel in the air or somewhere where the player will never be at the same position?

1 Like

I sorta don’t understand what you mean because my english is bad but, this glitch only occurs once the player is fully zoomed in. In 3rd person they’re fine, I tested that. So if that changes anything?

1 Like

I think this topic is going to get submerdged and looked over. Well rip.

1 Like

Not enough info dependent on the view model setup,

I’m guessing there are humanoids in the viewmodel so its similar to this other problem

Oh yes there is a humanoid in it ill marked this as solved if you’re right thanks.

Nope didn’t work:

local Cam = workspace.CurrentCamera
local ViewModel = game.ReplicatedStorage:WaitForChild("ViewModel"):Clone()
ViewModel:WaitForChild("Humanoid").PlatformStand = true
ViewModel.Parent = Cam
local Player = game.Players.LocalPlayer
local Character = script.Parent
local Camera = workspace.CurrentCamera
local RunService = game:GetService("RunService")
 
local ViewModel = game.ReplicatedStorage.ViewModel:Clone()
ViewModel.Parent = Camera
 
RunService.RenderStepped:Connect(function()
	if Character:WaitForChild("Humanoid").Health == 0 then
		if Camera:FindFirstChild("ViewModel") ~= nil then
			Camera.ViewModel:Destroy()
		end
	end
 
	if Camera:FindFirstChild("ViewModel") ~= nil then
		Camera.ViewModel:SetPrimaryPartCFrame(Camera.CFrame * CFrame.new(.025, -1.5, -1))
	end
end)
2 Likes

Unless I’m meant to enable platformstand without scripting if there is some sort of way? Edit: nevermind I checked the box in properties still has the same issue.

I have this problem with my viewmodel too. When looking down with a longer gun even if the gun isn’t collidable (it isn’t) it pushes the player.

This might be an actual bug then for roblox???

1 Like

Probably not, must be a bug within the module, perhaps try contacting the one who made it?

1 Like

It’s not a module though. I said toolbox because I didn’t want people asking for the viewmodel but someone actually gave it to me. It’s not old. These are all the things it has in it:
Screenshot 2024-05-23 233931

1 Like

are the parts in the viewmodel in the cannotcollide collision group

2 Likes

I’m sorry guys, I’m not an expert at collisiongroups so this was the issue. However, @DAT_BOI875 one more question I’d like to ask. I just used the collisiongroup property and now it works. But there is this little warning sign here which I don’t understand. Is there a way I can get rid of it?
Screenshot 2024-05-24 125823

sorry for the late reply but i have no idea what that is

Oh alright, I have a follow-up problem to the topic. Could you take a look please? Viewmodel meshids not working

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.