How to rotate character

Hello developers, I am currently working on a script which moves the player and sets its orientation. However the character doesn’t seem to rotate. How can I make this work? Here is the script:

	player.CharacterAdded:Connect(function(character)
		wait(.01)
		if stage.Value ~= 0 then
			player.Character:MoveTo(workspace:WaitForChild("Checkpoints"):WaitForChild(tostring(maxLevel.Value)).Position)
			player.Character.Origin.Orientation = Vector3.new(0, 90, 0) --Setting orientation
		end
	end)

Thanks.

Use HumanoidRootPart rather than Origin

1 Like

Hello again, I just recognized that the character animations are glitching and the character is moving backwards. Also I cleared the script.

local function setCharacter ()
	local player = game.Players:GetPlayerFromCharacter(script.Parent)
	local char = script.Parent
	local leaderstats = player:WaitForChild("leaderstats")
	local stageStat = leaderstats:WaitForChild("Stage")
	
	
	char:WaitForChild("HumanoidRootPart").Orientation = Vector3.new(0,45,0)
end

setCharacter()

I basically solved the problem by using CFrames and a function that runs when a character is added:

char:WaitForChild("HumanoidRootPart").CFrame = checkpoints[tostring(stageStored)].CFrame

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