How to make a part face the same way as the player

I have this chair script but whenever I spawn it, its not facing the same way as the player

local Tool = script.Parent
local Player = Tool.Parent.Parent
local Char = Player.Character
local Hum = Char.Humanoid
local HumanoidRootPart = Char.HumanoidRootPart


Tool.Activated:Connect(function()
	if Hum.FloorMaterial ~= Enum.Material.Air then
	
		local Chair = game.ServerStorage["Plastic Chair"]:Clone()
		
		Chair.CFrame = Char.Torso.CFrame 
		Chair.Orientation = Vector3.new(-90,90,0)
		Chair.Parent = workspace
		
		
		
	end
end)

image

1 Like

Dont do that by changing the orientation.
Use lookAt to make this happen.(Use CFrame.lookAt())

1 Like

Part.Orientation = HumanoidRootPart.Orientation - Vector3.new(0, 180, 0)?

image
Ive tried using that but when I do that instead of changing its orientation it will be on its side

Maybe try adjusting the Vector3 values. I found this off another article hoping it would help :thinking:

If you struggle anymore I would suggest using CFrame.lookAt() as @Valkyrop suggested.

local Game = game
local Workspace = workspace
local Players = Game:GetService("Players")
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()

task.wait(5)
local Part = Instance.new("Part")
Part.Anchored = true
Part.CFrame = CFrame.new(Part.Position) * Character:GetPivot().Rotation
Part.Parent = Workspace

You just have the multiply a copy of the part’s (chair’s) CFrame with its rotational information stripped with a copy of the player’s character’s CFrame with its positional information stripped.