Hello, I have this code that when the player enters the game the script changes the character’s position and rotates it, but in the part that rotates the character “PrimaryPart.Orientation = Vector3.new(0, 180, 0)” the character moves Backwards, I tried other methods, but none of them worked. The script is in the ServerScriptService.
Script:
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
repeat task.wait() until Character.Parent == workspace
local Humanoid = Character:WaitForChild("Humanoid")
local PrimaryPart = Humanoid.Parent.PrimaryPart
PrimaryPart.Orientation = Vector3.new(0, 180, 0)
PrimaryPart.CFrame = CFrame.new(-478.115, 35.064, -50.953)
end)
end)
Since CFrame is position and rotation, setting the CFrame also sets the rotation. You are undoing the orientation change by changing the CFrame afterwards.