mirror of
https://github.com/centau/vide.git
synced 2026-08-20 14:41:37 +00:00
Check for TweenInfo existence before use
fixed check fail
This commit is contained in:
parent
042d56bf73
commit
8ca9e9b440
1 changed files with 2 additions and 0 deletions
|
|
@ -1,11 +1,13 @@
|
||||||
-- src/tween.luau
|
-- src/tween.luau
|
||||||
local TweenService = game and game:GetService("TweenService") or nil
|
local TweenService = game and game:GetService("TweenService") or nil
|
||||||
|
local HasTweenInfo = (TweenInfo ~= nil)
|
||||||
|
|
||||||
-- Factory: inject action + cleanup so tweens are stopped on scope destruction
|
-- Factory: inject action + cleanup so tweens are stopped on scope destruction
|
||||||
return function(action, cleanup)
|
return function(action, cleanup)
|
||||||
local tween = {}
|
local tween = {}
|
||||||
|
|
||||||
-- Presets (simple, useful)
|
-- Presets (simple, useful)
|
||||||
|
if HasTweenInfo then
|
||||||
tween.presets = {
|
tween.presets = {
|
||||||
instant = TweenInfo.new(0),
|
instant = TweenInfo.new(0),
|
||||||
fast = TweenInfo.new(0.12, Enum.EasingStyle.Quad, Enum.EasingDirection.Out),
|
fast = TweenInfo.new(0.12, Enum.EasingStyle.Quad, Enum.EasingDirection.Out),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue