I am attempting to create an effect when the player falls through a ring. While everything within the code works I want to add a smooth tween effect to add to the game. First off, the ring I want to tween is a model which, according to this amazing resource, I am using welds. The method works by welding all the parts to one center part (or the primary part) and tweening that primary part. This method works great with only one drawback: Welds only work when CFrame
is used as the variable change. This leads me to this code:
local TweenService = game:GetService("TweenService")
local PrmyPart = workspace.Skydiving.Rings.Ring5.PrimaryPart
local startRotInfo = TweenInfo.new(.4, Enum.EasingStyle.Back, Enum.EasingDirection.In)
local loopRotInfo = TweenInfo.new(.2, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 10)
This is, of course, after I have welded the parts to the primary part. When ran the desired rotation effect is achieved however I also want to drop the ring downwards (This effect is very similar to the Mario coin gain effect). While the simple answer would be “Tween the CFrame”, I can’t because the second rotation tween loops and this would cause the ring position to loop as well (it would never drop). I am trying to achieve either two tweens at once or any other solution. Here is what I have without the drop:
local TweenService = game:GetService("TweenService")
local PrmyPart = workspace.Skydiving.Rings.Ring5.PrimaryPart
local startRotInfo = TweenInfo.new(.4, Enum.EasingStyle.Back, Enum.EasingDirection.In)
local loopRotInfo = TweenInfo.new(.2, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 10)
local startTwn = TweenService:Create(PrmyPart, startRotInfo, {CFrame = PrmyPart.CFrame * CFrame.Angles(0, math.rad(90), math.rad(89))})
startTwn:Play()
startTwn.Completed:Wait()
local loopTwn = TweenService:Create(PrmyPart, loopRotInfo, {CFrame = PrmyPart.CFrame * CFrame.Angles(0, 0, math.rad(179))})
loopTwn:Play()
Thanks in advance for any help!