Jointing gun makes character fly

I’m making a FPS with a viewmodel and all that stuff. The problem is making the server side. For some reason, when I use a Motor6D to joint a gun with the players character, the latter starts flying. I already used a similar method to joint the gun with the viewmodel and it worked fine. Here’s a video that demonstrates the issue. And yes, every gun part is canCollide false.

Code used:

SetupServer.OnServerEvent:Connect(function(player, weapon) 
	local serverWeapon = weapon:Clone()
	local joint = Instance.new("Motor6D")
	joint.Part0 = player.Character.RightHand
	joint.Part1 = weapon.Handle
	joint.Parent = player.Character.RightHand
	serverWeapon.Parent = player.Character
end)

If you know the reason for this, please let me know. Thanks in advance.

Is the gun massless? Are there any other scripts affecting this?

1 Like

The gun isn’t massless but doing so doesn’t change this behaviour. If Inverse Kinematics affects it, then there is just one script that uses IK to rotate the character’s torso to wherever the player is looking, but I don’t think that it would cause such anomaly.

Custom CollisionGroup for the gun is the best advice i can give.

1 Like

Oh my god my bad, I just saw that I used the original weapon in Part1 instead of the cloned server weapon. Thanks for your help anyways.

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