ql440
(MrCheese)
February 26, 2025, 2:03pm
1
So, i want to make it so that the part can spin and the arms open, but whatever i can’t find any solutions. I have googled it and tried many solutions but none of them work. I’ll send code to both of these scripts.
local speed = script.Parent.RotationSpeed
while wait() do
script.Parent:SetPrimaryPartCFrame(script.Parent.WhiteM.CFrame * CFrame.fromEulerAngles(0,0,speed.Value))
end
and
local cframeTween = Instance.new("CFrameValue")
cframeTween.Value = script.Parent:GetPrimaryPartCFrame() -- Starter Cframe
game:GetService("TweenService"):Create(cframeTween, TweenInfo.new(6), {Value = script.Parent:GetPrimaryPartCFrame() * CFrame.Angles(0, 0, math.rad(-60))}):Play()
cframeTween:GetPropertyChangedSignal("Value"):Connect(function()
script.Parent:SetPrimaryPartCFrame(cframeTween.Value)
end)
(this is code of one of the arms)
The first script has more scripts inside a number value determining the speed for rotation. The second one is ran by another script which activates them all at once.
Here is an video i took as well.
1 Like
Maybe your best option is to use the animation editor because I don’t think there is an easy way to do that with TweenService and CFrame
You can follow a tutorial.
Ehtrab
(Ehtrab)
February 26, 2025, 5:02pm
3
a solution I have for you is to use weld, setup the C0 for the offset (you can use a plugin) and then you tween the C1 for the animation
the code an I used in the video:
local TweenService = game:GetService("TweenService")
local speed = workspace.DistributedGameTime / 100
local spinPart = script.Parent.WhiteM
local WeldToTween = script.Parent.WhiteM.ManualWeld
task.delay(6, function()
TweenService:Create(WeldToTween, TweenInfo.new(6), {C1 = CFrame.new(2, 2, 0) * CFrame.fromEulerAngles(0, 0, math.rad(90))}):Play()
task.delay(8, function()
TweenService:Create(WeldToTween, TweenInfo.new(3), {C1 = CFrame.new(0, 0, 0) * CFrame.fromEulerAngles(0, 0, 0)}):Play()
end)
end)
while wait() do
speed = workspace.DistributedGameTime / 100
script.Parent:PivotTo(spinPart.CFrame * CFrame.fromEulerAngles(0,speed,0))
end
2 Likes
ql440
(MrCheese)
February 26, 2025, 5:04pm
4
I’ll try this, looks promising
ql440
(MrCheese)
February 26, 2025, 5:08pm
5
just one thing, speed is supposed to be the value i use right?
Ehtrab
(Ehtrab)
February 26, 2025, 5:10pm
6
yes, in my code is a little bit different because it was for the video example
1 Like
ql440
(MrCheese)
February 26, 2025, 5:13pm
7
i still need help i can’t figure it out myself.
Ehtrab
(Ehtrab)
February 26, 2025, 5:14pm
8
can you send me what you don’t understand?
1 Like
ql440
(MrCheese)
February 26, 2025, 5:15pm
9
dont understand how to adjust C0 and C1, got some sketchy plugin
ql440
(MrCheese)
February 26, 2025, 5:17pm
10
also, can you make it into a module so i can call the function when i need to open the arms and close them
Ehtrab
(Ehtrab)
February 26, 2025, 5:21pm
11
I use this plugin if you want: https://create.roblox.com/store/asset/148570182/Weld?viewFromStudio=true&keyword=weld&searchId=45ccf461-926c-47a9-95fb-f1a4140bbca7
just this plugin will set the c1 you just set everything in the c0 with negative and reset c1 to 0,0,0 same for the orientation because is a cframe
1 Like
ql440
(MrCheese)
February 26, 2025, 5:24pm
12
can you weld model to part?
Ehtrab
(Ehtrab)
February 26, 2025, 5:29pm
13
model you mean? What you can do is choose what part in the model will be the primarypart that mean the one that use the weld and the other one you can weld them to the primarypart of the model with a WeldConstraint but don’t forget to unanchor them the only one you can anchor will be WhiteM
1 Like
ql440
(MrCheese)
February 26, 2025, 5:30pm
14
i’ll try right now. Not sure if it will work tho
ql440
(MrCheese)
February 26, 2025, 5:48pm
15
i did this but it just falls off when i test run
Ehtrab
(Ehtrab)
February 26, 2025, 5:57pm
16
you keep the part that spin anchored ? and do you weld them all correctly ? if you move them in studio with drag the weld can break
1 Like
ql440
(MrCheese)
February 26, 2025, 5:58pm
17
I have an idea, i can friend you so you can just come in here and quickly do it. Sounds good?
Ehtrab
(Ehtrab)
February 26, 2025, 6:01pm
18
Sure, no problem but i need to be fast because i have to go soon
1 Like
ql440
(MrCheese)
February 26, 2025, 6:02pm
19
alright, i sent you a friend request
ql440
(MrCheese)
February 26, 2025, 6:02pm
20
there we go i allowed you access to edit