How do i make this model not tilted

I have been trying to fix this for a while, and I’m not sure how to context this.
Structure bug

I want the spawn point to just be flat.

StructureClass.new(team, "SpawnPoint", CFrame.new(chosenPosition, Vector3.new(0, 0, 0)))

I’m sure the orientation is the problem, but I don’t know how to fix it.

Remove this. This will make the spawn point look toward 0,0,0.

I tried that, but it didn’t work.

Is it still titled? If that doesn’t work, you can simply make it look to right below the position.

CFrame.new(chosenPosition, chosenPosition-Vector3.new(0,1,0))

It didn’t work. I think it might be a problem with this function now.

local function PlaceStructure(model, cframe)
	model:SetPrimaryPartCFrame(cframe)
	
	local rayParams = RaycastParams.new()
	rayParams.FilterType = Enum.RaycastFilterType.Blacklist
	rayParams.FilterDescendantsInstances = {model, game.Workspace.Map.Structures}
	
	local result = game:GetService("Workspace"):Raycast(model.PrimaryPart.Position, model.PrimaryPart.Position + Vector3.new(0, -100, 0), rayParams)
	
	if result then
		local newPosition = Vector3.new(model.PrimaryPart.Position.X, result.Position.Y, model.PrimaryPart.Position.Z)
		local newCFrame = CFrame.new(newPosition, model.PrimaryPart.Orientation)
		
		model:SetPrimaryPartCFrame(newCFrame)
	end
end

I would say the issue could(?) be this

Set the newCFrame to this:

local newCFrame = CFrame.new(newPosition, newPosition-Vector3.new(0,1,0))

You could also leave it blank (depending on the model), but this is the most surefire way.

I left it blank and it’s not tilted anymore. Thanks!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.