skowdash
(skowdash)
May 5, 2021, 4:41am
#1
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
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
skowdash
(skowdash)
May 5, 2021, 5:04am
#3
i don’t know why it does works
Is it giving an error? in output
skowdash
(skowdash)
May 5, 2021, 5:07am
#5
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
skowdash
(skowdash)
May 5, 2021, 5:11am
#7
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?
Rynappel
(Rynappel)
May 5, 2021, 5:14am
#9
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
skowdash
(skowdash)
May 5, 2021, 5:14am
#10
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)
skowdash
(skowdash)
May 5, 2021, 5:23am
#11
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
skowdash
(skowdash)
May 5, 2021, 5:34am
#13
Thanks You every much man it works
1 Like
No problem, I enjoy helping other devs
Rynappel
(Rynappel)
May 5, 2021, 6:07am
#15
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