Hi, I’m trying to tween a gun, it’s called the FMG9 and it’s supposed to pop out, but for some reason, my tween isn’t working? Here is the tween script:
local tween = game:GetService(“TweenService”)
local info = TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0, false, 0)
local info1 = TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0, false, 0)
local goal = {Position = script.Parent.Parent.Parent.Parts.Stuff.Flip1.Position}
local goal1 = {Position = script.Parent.Parent.Parent.Parts.Stuff.Stock1.Position}
local tween1 = tween:Create(script.Parent.Parent.Parent.Parts.Stuff.Flip, info, goal)
local tween2 = tween:Create(script.Parent.Parent.Parent.Parts.Stuff.Stock, info1, goal1)
script.Parent.OnServerEvent:Connect(function()
if script.Parent.Parent.Parent.Values.Flipped.Value ~= true then
tween1:Play()
tween2:Play()
script.Parent.Parent.Parent.Sounds.Flip:Play()
wait(1)
script.Parent.Parent.Parent.Values.Flipped.Value = true
end
end)
Need more info. Does the sound play? Maybe add some prints inside the connected function to see if it actually ever called. Tweens look fine. The function is either never called or does not pass the if.
Ok I googled the gun and it looks like the unfolding is performed with rotation. However you seem to only animate position. Do the end parts (Flip1, Stock1) have rotation or just position differences?
They have rotation too D: 30chars
I’ve used lerp for a long time, and this is probably the reason why… I’m really new to tweening because I don’t like the long process of tweening
So you know how roblox requires comments to be 30 characters long to prevent spam? Well since my thing isn’t 30 characters long, I add 30charssssssss to make it 30 characters.