You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I want to tween parts (not for motion but for rotation) while they are already moving (in a spinning motion).
I have 3 parts here for demonstration (this is the desired motion of the crystals but they don’t move):
These are how the crystals move right now (they are supposed to rotate but don’t)
I have print statements in the script that tell me that it SHOULD run through the tweens
Here is the code:
local tweenService = game:GetService("TweenService")
local forwardTweens = {}
local backwardTweens = {}
while true do
task.wait(0.01)
for _, crystal in ipairs(script.Parent:GetChildren()) do
if crystal:IsA("UnionOperation") then
tween1 = tweenService:Create(
crystal,
TweenInfo.new(2.5, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut),
{CFrame = crystal.CFrame * CFrame.Angles(math.rad(-47), 0, 0)}
)
tween2 = tweenService:Create(
crystal,
TweenInfo.new(2.5, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut),
{CFrame = crystal.CFrame}
)
table.insert(forwardTweens, tween1)
table.insert(backwardTweens, tween2)
end
print("Tweens created")
end
for _, tween in ipairs(forwardTweens) do
tween:Play()
print("Tween1 played")
end
forwardTweens[1].Completed:Wait()
for _, tween in ipairs(backwardTweens) do
tween:Play()
print("Tween2 played")
end
backwardTweens[1].Completed:Wait()
forwardTweens = {}
backwardTweens = {}
end
Can someone help me? Thanks
By the way I wrote this at like 2:30 AM so I might not respond for a bit