How would I rotate this object in a certain position?

I have an object going through my character and this is the script for it:

Image:

image

Script:

Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)
		local PartHolder = ObjectsFolder.PartHolder:Clone()
		PartHolder:PivotTo(Character.HumanoidRootPart.CFrame)
		PartHolder.Parent = Character
		
		local PartHolderWeldConstraint = Instance.new("WeldConstraint")
		PartHolderWeldConstraint.Part0 = PartHolder.PrimaryPart
		PartHolderWeldConstraint.Part1 = Character.PrimaryPart
		PartHolderWeldConstraint.Parent = PartHolderWeldConstraint.Part0
		
		local Part = ObjectsFolder.Part:Clone()
		Part:PivotTo(PartHolder.Holder.CFrame)
		Part.Parent = Character
		
		local PartWeldConstraint = Instance.new("WeldConstraint")
		PartWeldConstraint.Part0 = Part.PrimaryPart
		PartWeldConstraint.Part1 = PartHolder.PrimaryPart
		PartWeldConstraint.Parent = PartWeldConstraint.Part0
	end)
end)

I have no idea what you want to happen, if you please can, be more specific.
If you are asking how to rotate the object to your likings do this:

Part.Orientation = Vector3.new(0,0,0) -- // Change values to your preference.

But judging from your code, I think you already know what orientation is, so I think I misjudged your question, if so, please give me more description on what you want to happen.

2 Likes

If you’re talking about how to make the part face another part this might help:

Although for people to correctly help you you need to be more specific please.