How do i get the player to be welded and be immobile on a moving part? Im trying to recreate the effect were the player is welded onto a ship and cannot move or fall off, like in tradelands (on any ship) and galaxy (on other player’s carriers).
The issue is that the player can still move and moves the object with him.
I’ve tried putting the player into platformstand mode with Humanoid:ChangeState(Enum.HumanoidStateType.PlatformStanding) and Humanoid.PlatformStand = true, but both dont seem to be doing anything.
My method is to constantly update the player’s character’s primary part’s CFrame relative to the part based on run service.
local runService = game:GetService("RunService") -- retrieve RunService from game
--Begin weld
local Relative_CFrame = Carrier.Part.CFrame:ToObjectSpace(character.PrimaryPart.CFrame)
character.PrumaryPart.Anchored = true -- Anchor so it doesnt have weird physics
local Update = runService.Stepped:Connect(function()
character.PrimaryPart.CFrame = Carrier.Part.CFrame * Relative_CFrame
end)
wait(3)
--Stop update
Update:Disconnect()
character.PrimaryPart.Anchored = false
1 Like
thanks, but i realized now that a module that i use basically messes with anchoring and attaching the player to anything. I will try to fix that until it works. Thanks for your code though, that can be useful when i fix my code.