CFrame rotation problems

Hey, i’m trying to set the player’s root CFrame to a part’s, and the position of the rootpart changes, but not the rotation. Am i doing something wrong?

local function spawnAtPart(part)
	for _, player in ipairs(Players:GetPlayers()) do
		local character = player.Character or player.CharacterAdded:Wait()
		character:PivotTo(part.CFrame)
	end
end

are there any possibilities that you accidentally edited parts Pivot in Edit Pivot mode and not the actual orientation?

1 Like

uh… could you elaborate?


Edit Pivot gives you visually same interaction model as Rotation, but it changes Parts pivot not the Rotation, my question is do you actually see the part being rotated

1 Like

yeah as far as i know the rootpart isn’t rotating at all

Not sure about this problem, but set the CFrame of the HumanoidRootPart. I am pretty sure this will work.

changed it to this, same problem and nothing changed

local function spawnAtPart(part)
	for _, player in ipairs(Players:GetPlayers()) do
		local character = player.Character or player.CharacterAdded:Wait()
		local hrp = character:FindFirstChild("HumanoidRootPart")
		
		if hrp and part then
			hrp.CFrame = part.CFrame
		end
	end
end

Just making sure, have you tried rotating the part to see if the character rotation changes at all?

yes i tried rotating the part, nothing different

Character:PivotTo(part:GetPivot()) this possibly cannot not work

1 Like

are u calling the function? it worked for me.

local Players = game:GetService("Players")

local function spawnAtPart(part)
	for _, player in ipairs(Players:GetPlayers()) do
		local character = player.Character or player.CharacterAdded:Wait()
		character:PivotTo(part.CFrame)
	end
end

Players.PlayerAdded:Connect(function(plater)
	plater.CharacterAdded:Connect(function()
		spawnAtPart(workspace.Part)
	end)
end)
1 Like

i think the problem is that i’m in first person, ill work on it

1 Like

And it never occurred to you???

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