How to move a model?

So I’m currently trying to move a model to the players position although the orientation keeps changing


This is the code I currently have for this.

while wait() do
	for i,v in pairs(workspace.Enemies:GetChildren()) do
		v.Humanoid.Touched:Connect(function(hit)
			if deb == false then
				local player = players:GetPlayerFromCharacter(hit.Parent)
				if not player then return end
				deb = true
				print("Enemy Touched by: "..player.Name)
				startBattle:FireServer()
			end
		end)
	end
end
startBattle.OnServerEvent:Connect(function(player)
	local battleArea = servStorage["Battle Area"]:Clone()
	battleArea:SetPrimaryPartCFrame(player.Character.HumanoidRootPart.CFrame)
	battleArea.Parent = workspace
end)
1 Like

CFrame consists of a Vector3 position AND it’s orientation. To move a model without changing it’s orientation, you can simply do the following in the server script:

startBattle.OnServerEvent:Connect(function(player)
	local battleArea = servStorage["Battle Area"]:Clone()
	battleArea:SetPrimaryPartCFrame(CFrame.new(player.Character.HumanoidRootPart.Position))
	battleArea.Parent = workspace
end)

Hmm that still didn’t seem to work :confused:


Yeah just in case it should be flat like that by the way just saying because I didn’t include what it’s supposed to look like lol.

edit again: Nvm I solved it just had to do

battleArea:SetPrimaryPartCFrame(CFrame.new(player.Character.HumanoidRootPart.Position)*CFrame.Angles(0,0,math.rad(90)))