Errors With SetPrimaryPartCFrame()

Hello! I’m making crushing script, but I want my models spawn rotated normally.
Problem:

Local Script:

local Player = game.Players.LocalPlayer
local PlayerMouse = Player:GetMouse()

--[[

PlayerMouse.Hit.p = Tıklanan Pozisyon
.Target = Tıklanan Şey

]]


PlayerMouse.Button1Down:Connect(function()


			game.ReplicatedStorage.RemoteEvents.SpawnCrusher:FireServer(script.Parent.Name, PlayerMouse.Hit,PlayerMouse.Target)
	


end)

Server Script:

local Crushers = game.ReplicatedStorage.Crushers
local Height = 30


game.ReplicatedStorage.RemoteEvents.SpawnCrusher.OnServerEvent:Connect(function(Player,CrusherName,Pos,Target)
	
	
	if Target == game.Workspace.SafeZone then
		print("ITS SAFEZONE!")
		return
	end
	
	local NewCrusher = Crushers[CrusherName]:Clone()
	NewCrusher.Parent = game.Workspace.WorkingCrushers
	NewCrusher:SetPrimaryPartCFrame(Pos + Vector3.new(0,Height,0))
		
		

	


	
end)

Please help!
I want the model rotates straight to floor!

You should be using MoveTo instead, since in your code, you are using SetPrimaryPartCFrame with the mouse hit cframe, which would cause some rotation

MoveTo takes a Vector3, so use mouse.Hit.Position

OH MY GOD! Thank you very much, I’ve been working on this for 4 Hours! HUGE LIFESAVER!

1 Like