I have a circle of spawns and I want all the players to be facing the middle of the circle when they spawn, how can I do that? I don’t really want to manually test and rotate all of the spawns so can anyone help me out?
You can use
rootpart.CFrame = CFrame.lookAt(rootpart.Position, Vector3.new(circleCenter.X, rootpart.Position.Y, circleCenter.Z))
rootpart is the HumanoidRootPart of the player’s character and
circleCenter is a position of the center of the circle.
You can do it fairly easily by placing two opposite spawns manually, then duplicating with
Ctrl+D and rotating:
If that won’t work for you, you can use this snippet in the Command Bar:
for _, v in pairs(game.Selection:Get()) do v.CFrame = CFrame.new( v.Position, v.Position + ( Vector3.new(10, 0, 10) - v.Position ) * Vector3.new(1, 0, 1) ) end
You select the parts you want rotated and type in a different position where it says
10, 0, 10.
Take care, undo won’t work to un-rotate the parts!