Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can I turn the part the direction the character is facing?

I want the part to face the direction the character is looking at but currently it's facing in the air so I probably would need to turn it around by 90degrees but idk how, that's what I have

local x = game.ReplicatedStorage.DFItems.Portal:Clone()
x.Parent = workspace
x.CFrame = character.HumanoidRootPart.CFrame

1 answer

Using CFrame will also set the position of the part, because it holds position and orientation, so I made an example script to show you.

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		while wait() do
			script.Parent.Orientation = char.UpperTorso.Orientation
			end
	end)
end)

You could implement this into your script by doing this

local x = game.ReplicatedStorage.DFItems.Portal:Clone()
x.Parent = workspace
while wait() do
x.Orientaton = character.HumanoidRootPart.Orientation
end

This is a assuming you have a character variable already set by some method.

2 comments

0

nah its like before now its still looking in the air

0

is there a method to turn it 90 degrees

This discussion is preserved as it was. New answers, comments, and votes are closed.