Hello Developers!. Recently I have been working on many different Mini-games to improve my skill-set.
I have started working on a Whac-A-Mole type game, I have un-anchored and welded all my parts to one main part.
and when I try tween it downwards by -1 on the Y axis it works quite well,However when I try tween up the model by adding
- 1 back on the Y axis it is completely twisted, I’m not sure why this is the case.
GIF::
https://gyazo.com/6a8200d92aef1107d56b506435eba979
local function DiglettTween(mainpart)
local TweenService = game:GetService("TweenService")
local tInfo = TweenInfo.new(1,Enum.EasingStyle.Elastic,Enum.EasingDirection.Out)
local X = mainpart.CFrame.X --0.161
local Y = mainpart.CFrame.Y - 1
local Z = mainpart.CFrame.Z
local goals = {}
goals.CFrame = CFrame.new(X,Y,Z)
local Y2 = mainpart.CFrame.Y + 1
local Goals2 = {}
Goals2.CFrame = CFrame.new(X,Y2,Z)
local Tween1 = TweenService:Create(mainpart,tInfo,goals)
local Tween2 = TweenService:Create(mainpart,tInfo,Goals2)
if mainpart.CFrame.Y > 1.555 then
print("We need to Tween Down")
Tween1:Play ()
else
Tween2:Play ()
print("We need to Tween Up")
end
end