I tried to make a Mount system for my game where you can ride animals and to do that I make the player invisible and I teleport the animal to the players position and weld it to the players humanoidrootPart using weldconstraint and it works good, but whenever I teleport the player there is an about 1 in 2 chance that the player floats and becomes unable to move
hhere are the codes that I use: To Equip Mount:
local playerMount = game.ReplicatedStorage.Mounts:FindFirstChild(player.EquippedMount.Value):Clone()
playerMount.Name = player.Name.."Mount"
playerMount.Parent = workspace
playerMount.HumanoidRootPart.CFrame = (character:GetPrimaryPartCFrame() - Vector3.new(0,(character.HumanoidRootPart.CFrame.Position.Y - (character.LeftFoot.Position.Y - character.LeftFoot.Size.Y/2)) - playerMount.HumanoidRootPart.Size.Y/2,0))
local weld = Instance.new("WeldConstraint")
weld.Parent = playerMount
weld.Part0 = playerMount.HumanoidRootPart
weld.Part1 = character.HumanoidRootPart
for i,v in pairs(character:GetDescendants()) do
if (v:IsA("BasePart") or v:IsA("Decal")) and v:FindFirstAncestorWhichIsA("Model").Name ~= player.Name.."Pet" then
print(v)
v.Transparency = 1
end
end
To Teleport:
player.Character.HumanoidRootPart.CFrame = CFrame.new(game.Workspace.MapFolder:FindFirstChild(“PetShopRingWorld”…tostring(Currency.Value), true).Position + Vector3.new(0,5 ,10))
I tested lots of things and i realised it is because a humanoid (a pet) that was cloned on client was deleted but I still dont know how to fix this. Can someone tell me why the player sinks when I delete it?