local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local hrp = character:WaitForChild("HumanoidRootPart")
local part = Instance.new("Part")
part.Parent = workspace
part.Anchored = true
part.Position = Vector3.new(0, 50, 0)
while task.wait() do
part.Orientation = Vector3.new(part.Orientation.X, hrp.Orientation.Y, part.Orientation.Z)
end
Sorry, but in the game you dont play with a character, i will hide it anchored
But i find this:
wait(4)
local humanoid = script.Parent:WaitForChild("Humanoid")
script.Parent.Humanoid:GetPropertyChangedSignal("MoveDirection"):Connect(function()
local md = humanoid.MoveDirection
--print(Vector3.new(md.X,0,md.Z))
print(md)
local angle = math.ceil(math.deg( math.atan2(md.X, -md.Z)) - 0.5) * -1 -- -1 bc it rotate backwards
--if angle == -180 then angle = 0 end --When the player stop, the part look backward i cant fix it (0,0,0 = 180, 180 * -1 = -180)
warn(angle)
workspace.SpawnLocation.Orientation = Vector3.new(0,angle,0)
end)
It dont work when player stop moving, the part look backwards
And i dont understand the math