How do you convert the player character to a model like a chair or table, not a rigged model like how Blox Hunt is doing?
I tried two things. the first one to make a weld constraint for the model and the humanoid root part and make the other part (arm, leg, etc.) invisible, but there is a problem when setting the CFrame for the model, the problem that I can’t get in perfect some reasons it work good for big models and bad for smaller ones.
local ServerStorage = game:GetService("ServerStorage")
local Players = game:GetService("Players")
function AttatchModel(character: Model)
local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
local rightLeg = character:FindFirstChild("Right Leg")
local model = ServerStorage.Chair
model.Parent = character
if math.floor(model:GetExtentsSize().Y) > 3 then
model.PrimaryPart.CFrame = humanoidRootPart.CFrame * CFrame.new(0, -((humanoidRootPart.Size.Y + rightLeg.Size.Y) - (model:GetExtentsSize().Y / 2)), 0)
else
model.PrimaryPart.CFrame = humanoidRootPart.CFrame * CFrame.new(0, -((humanoidRootPart.Size.Y + rightLeg.Size.Y) - model:GetExtentsSize().Y), 0)
end
local weld = Instance.new("WeldConstraint")
weld.Part0 = model.PrimaryPart
weld.Part1 = humanoidRootPart
weld.Parent = model
end
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAppearanceLoaded:Connect(function(character: Model)
for _, part in character:GetDescendants() do
if part:IsA("Accessory") then
part:Destroy()
elseif part:IsA("Part") then
if part.Name == "Head" then part:FindFirstChildOfClass("Decal"):Destroy() end
part.Transparency = 0.8
end
end
AttatchModel(character)
end)
end)
The second thing I tried was to set the model for the player character by adding to it a humanoid and a humanoidRootPart, but there was a problem floating because the HipHight needed a lot of setup.
The models used have cancolide set to false. These are the two methods I tried. If there is something better, please tell me.