Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Accessory's position is under the baseplate even though I set it at the head?

Asked by 5 years ago
local InsertService = game:GetService("InsertService")

game.Players.PlayerAdded:Connect(function(Playe)
    wait(1)
    as = InsertService:LoadAsset("1029025")
    as.Parent = Playe.Character
    as.Fedora.Handle.Position = Vector3.new(Playe.Character.Head.Position)
    local Weld = Instance.new("Weld")
    Weld.Part0 = Playe.Character.Head
    Weld.C0 = Playe.Character.Head.CFrame:Inverse()
    Weld.Part1 = as.Fedora.Handle
    Weld.C1 = as.Fedora.Handle.CFrame:Inverse()
    Weld.Parent = as.Fedora
end)

All it does is set the hat under the baseplate instead of the head. Try it out for yourself. Put this script inside workspace.

1 answer

Log in to vote
1
Answered by 5 years ago

You attempted to construct A Vector3 out of another Vector3.

as.Fedora.Handle.Position = Vector3.new(Playe.Character.Head.Position)

Playe.Character.Head.Position is already a Vector3, and if you give improper arguments to this function, you just get a Vector3 instance at the origin.

Simply remove the call and this code works;

as.Fedora.Handle.Position = Playe.Character.Head.Position
Ad

Answer this question