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

[CFrame ] why the model is not rotated in the direction of the player?

Asked by 4 years ago
local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(char)

    while true do
        script.Parent:SetPrimaryPartCFrame(script.Parent.Torso.CFrame, char.HumanoidRootPart.CFrame)
        wait(0.5)
    end

    end)
end)

I'm not good at working with vectors and CFrame:(

1 answer

Log in to vote
0
Answered by 4 years ago

First of all, make sure you have set a part to be the primary part.

Secondly, there is only one parameter for the SetPrimaryPartCFrame function—a CFrame value. Try doing: script.Parent:SetPrimaryParyCFrame(CFrame.new(script.Parent.PrimaryPart.Position, char.HumanoidRootPart.Position))

Ad

Answer this question