Npc carry player have weird movement

so I try to make NPC carry the player using seat and weld, but both have the same problem, looks like they can’t sync between client and server,

here is the result when I use seat

code :

	local Seatpart= basenpc:FindFirstChild("Seatpart")	
		Seatpart.Seat.Disabled = false
		hrp.CanCollide = false --player collision
		UpperTorso.CanCollide = false --player collision
		LowerTorso.CanCollide = false --player collision
	 
		hrp.CFrame = Seatpart.CFrame
		humanoid.Sit = true

I also tried using weld with and without setnetworkowner

here is the result with setnetworkowner to nill(server) , look fine on server side but broken(freeze) on client side

without setnetworkowner

code :

local seatpart = basenpc:FindFirstChild("seatpart")	

	hrp.CanCollide = false --player collision
	UpperTorso.CanCollide = false --player collision
	LowerTorso.CanCollide = false --player collision

	local weld = Instance.new("WeldConstraint", hrp)
	hrp.CFrame = seatpart.CFrame
	weld.Parent = hrp
	weld.Part0 = hrp
	weld.Part1 = seatpart

any idea how to fix the movement? usually, it works fine when I do platformstand = true or sit = true, but it doesn’t work on the player even I set player control to disable

local Controls = require(player.PlayerScripts.PlayerModule):GetControls()
Controls:Disable()

thanks

Maybe try setting CanCollide to OFF when the npc drags the player?

yep I did set player collision off for the player

Then I’m not really sure what’s causing this, the default Roblox pathfinder ain’t that great, also, not sure why you’d need a seat, considering you already disable the player’s controls and are setting the hrp’s cframe to it

yea Idk what the problem is, and no I didn’t use Roblox pathfinder, I use a* pathfinder module, Roblox pathfinder won’t work on map like this and their path.blocked event never works so I use a custom path,
because I didn’t loop the CFrame that’s why I need a seat or weld to make hrp keep sticking with the NPC

maybe add a constraint or weld?

Similar to how you’d weld a sword on a player’s back when it’s unequipped

1 Like

what is the difference between weld and WeldConstraint ? on the post I use WeldConstraint ,I will try to use weld

nvm I just google it, I think in this case using WeldConstraint is better

using WeldConstraint is 99% of the time always better, If you somehow move a part, the normal weld dissapears and I hate that

Also, if you want, make a part, uncollidable, in the location where you want your player to stick to the npc.

Weld the part (for example, “LockPart”) to the npc’s desired place and then weld the player to the “LockPart”.
When the player is welded, make sure to double check that they can’t collide with anything. Just turn off collidable for every part, including limbs or the head, alternatively you can use Collision groups but I don’t understand them completely

1 Like

roblox automatically turns collision on for humanoids, you could get around this by making a collision group called Grabbed and not letting it collide with anything, then setting the entire character to that collision group

1 Like

just tested it I make a new collision group called “grab” and untick everything so it will not collide with any objects on the workspace

	for _, part in ipairs(Chr:GetDescendants()) do
			if part:IsA("BasePart") then
				pyshic:SetPartCollisionGroup(part,"grab")
			end
		end

but still, have weird movements, looks like the physics of NPC(server) and player(client) pushing each other, I also tried to change the player state to physics on localscript

player.Character.Humanoid:ChangeState(Enum.HumanoidStateType.Physics)
Controls:Disable()

but still, have the same problem

I do setnetworkowner to nill for the player and its works like what I want, but it is only when I view it on serverside pov, when I switch to the client its just freeze the movement

I know why it freezes when I switch to the client POV on Roblox studio, it’s just a visual bug, IDK, I try testing it on a live server, and work as expected, thank you guys for your help