How can I rotate a cloned part?

How can I rotate this cylinder from vertical to horizontal, because whenever the dummy is cloned it comes out vertically and I don’t know how to fix it
image

 cilindro:Clone().Parent = game.Workspace
		local mancha = game.Workspace:WaitForChild("mancha")
		
		local big = tween:Create(mancha,info,size)
		local little = tween:Create(mancha,info,unsize)
		
		local rotar = CFrame.Angles(0, 0, math.rad(90))
		
		mancha.CFrame = mancha.CFrame:ToWorldSpace(rotar)
		mancha.CFrame = CFrame.new(lt.Position) + Vector3.new(0, -2.975, 0)

I have already tried several things but they do not work and the anchor is activated.

I believe this is the code you’re looking for

mancha.CFrame = CFrame.new(mancha.Position) * CFrame.Angles(0,0,math.rad(90))

You might need to change where math.rad(90) is in the CFrame.Angles but this script should work

1 Like

i don’t know why it does works

Is it giving an error? in output

everything works correctly but the cylinder always comes out with orientation z 0

Hmm maybe these scripts are setting it to be that way?

local rotar = CFrame.Angles(0, 0, math.rad(90))
		
		mancha.CFrame = mancha.CFrame:ToWorldSpace(rotar)
		mancha.CFrame = CFrame.new(lt.Position) + Vector3.new(0, -2.975, 0)

Try removing all of these scripts if you haven’t already

it doesn’t work either, I already tried everything

Hmmm can you share what the code looks like now?
Also is the mancha thing just a single mesh/part or a model?

use CFrame.Angles put this in somwhere

local clone = cilindro:Clone()
clone.CFrame = clone.CFrame * CFrame.angles(0, 90, 0) -- whatever here
clone.Parent = workspace
cilindro:Clone().Parent = game.Workspace
		local mancha = game.Workspace:WaitForChild("mancha")
		
		local big = tween:Create(mancha,info,size)
		local little = tween:Create(mancha,info,unsize)
		
		local rotar = CFrame.Angles(0, 0, math.rad(90))

		mancha.CFrame = mancha.CFrame:ToWorldSpace(rotar)
		mancha.CFrame = CFrame.new(lt.Position) + Vector3.new(0, -2.975, 0)

It doesn’t work either and I don’t know what happens

try this

cilindro:Clone().Parent = game.Workspace
		local mancha = game.Workspace:WaitForChild("mancha")
		
		local big = tween:Create(mancha,info,size)
		local little = tween:Create(mancha,info,unsize)
		
		local rotar = CFrame.Angles(0, 0, math.rad(90))

		mancha.CFrame = mancha.CFrame:ToWorldSpace(rotar)
		mancha.CFrame = CFrame.new(lt.Position) + Vector3.new(0, -2.975, 0)
                mancha.CFrame = CFrame.new(mancha.Position) * CFrame.Angles(0,0,math.rad(90))
1 Like

Thanks You every much man it works

1 Like

No problem, I enjoy helping other devs :smiley:

is the cilindro:Clone() the same as the findFirstChild(“mancha”)?
cause to reference the parts you don’t need to do that you can just

local mancha = cilindro:Clone()
-- do stuff
macha.Parent = workspace