Need help with rotation canceling eachother

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.

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

I’ll try this, looks promising

just one thing, speed is supposed to be the value i use right?

yes, in my code is a little bit different because it was for the video example

1 Like

i still need help i can’t figure it out myself.

can you send me what you don’t understand?

1 Like

image
dont understand how to adjust C0 and C1, got some sketchy plugin
image

also, can you make it into a module so i can call the function when i need to open the arms and close them

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

image
can you weld model to part?

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

i’ll try right now. Not sure if it will work tho

image
i did this but it just falls off when i test run

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

I have an idea, i can friend you so you can just come in here and quickly do it. Sounds good?

Sure, no problem but i need to be fast because i have to go soon

1 Like

alright, i sent you a friend request

there we go i allowed you access to edit