PivotTo() Not pivoting players character model

I’m currently working on a transforming ability where a player presses a button which fires a remote event on the server. Everything is working apart from when I use PivotTo(). The players character turns to a 90 degree default rotation. I’ve used MoveTo() and tried seperatly moving the rotation but nothing seems to work. I am using PivotTo() on other models and that seems to be working but I am stuck on trying to get this script to work:

game.ReplicatedStorage.MainGameRemoteEvents.TransformMonster.OnServerEvent:Connect(function(Player, rotation)
	print(rotation)
	if Player.Character.Name == "Monster" then
		local character = game.ReplicatedStorage.Characters[Player.Name] -- Get the original character
		character.Parent = workspace -- Set the character to the workspace
		character.UpperTorso.CFrame = Player.Character.UpperTorso.CFrame
		local vector = Player.Character -- Get the position of the monster
		Player.Character.Parent = game.ReplicatedStorage -- Set the monster to Replicated Storage
		Player.Character = character -- Set the players character to the character
		Player.Character:PivotTo(vector.PrimaryPart.CFrame) -- Move the original character to the players position
	else
		local monster = game.ReplicatedStorage.Characters.Monster:Clone() -- Clone the monster
		monster.Parent = workspace -- Set the monster to the workspace
		monster.UpperTorso.CFrame = Player.Character.UpperTorso.CFrame
		local vector = Player.Character -- Get the position of the original character
		local character = Player.Character:Clone()  
		character.Parent = game.ReplicatedStorage.Characters-- Set the players character to Replicated Storage
		Player.Character = monster -- Set the players character to the monster
		Player.Character:PivotTo(vector.PrimaryPart.CFrame) -- Move the monster to the players position
	end
end)

I would use Character:WaitForChild("Humanoid"):MoveTo(vector.PrimaryPart.Position)

EDIT: I didn’t read you already used this, sorry, is it anchored?

Might be an issue with the fact that you are trying to Pivot it right after setting it to a different model (just a guess), you could try pivoting it first then changing the model.

Man, you might actually be right

1 Like

I’ve placed the PivotTo() before I change the players character and It still has the same issue.

Try commenting the line out where you change the players character, and try it like that. Also, does it happen in both statements?

It happens if both statements, what do you mean by commenting the line out?

Like not changing the players character, remove that line (or comment it out by putting two -'s infront of it)

That seems to fix the issue but I’m not controlling the player because I don’t change it

Try pivoting the player, waiting like .5 seconds and then setting his character

The character still resets its rotation, I can see the character spawning with the correct rotation but then their rotation resets.