Rotating a model

Hello there.
This is my code:

	local base = workspace.Bases:FindFirstChild("Base"..PlayerNum)
	local floor = base.BaseFloor
	local centerpart = floor:FindFirstChild("CenterPart")
	local test = game.ServerStorage.TycoonAssets.AutoSpawns.DropperHolder:Clone()
	local isEven;
	if PlayerNum % 2 == 0 then
		isEven = true
	end
	
	local newpos = CFrame.new(centerpart.Position.X + 0.35, centerpart.Position.Y + 41.875, centerpart.Position.Z - 1.5)
	test.Parent = base
	test:PivotTo(newpos)

I’m aware it’s not particularly state of the art, but it’s meant for testing.
How do I rotate the test model by 180 degrees IF the playernum is even?

model.CFrame = model.CFrame * CFrame.Angles(0, 0, math.rad(180))

Move the Z value around until you got it to your liking. For example put it as X or Y.

Note it will not rotate depending on the WorldPosion, but on the ModelPosition also known as the the LocalPosition

1 Like

Use Model:SetPrimaryPartCFrame() and enter the CFrame, make sure you set a primary part.