Cleverish
|
  |
| Joined: 19 May 2013 |
| Total Posts: 314 |
|
|
| 24 Aug 2015 01:53 PM |
Does anyone have any super reliable tween functions that they don't mind sharing? Or at least a point in the right direction to make one with a Time feature would be amazing :)
If you're confused on what I mean, I mean like, a function that can tween smoothly between two numbers :) |
|
|
| Report Abuse |
|
|
|
| 24 Aug 2015 01:55 PM |
uhm
http://wiki.roblox.com/index.php?title=Tweening
pls do search before posting k thanks |
|
|
| Report Abuse |
|
|
Cleverish
|
  |
| Joined: 19 May 2013 |
| Total Posts: 314 |
|
|
| 24 Aug 2015 01:57 PM |
Pls read my post before posting :)
I don't mean TweenPosition/TweenSize, I just mean number tweening in general. I'm not sure what you would exactly call it, but a smooth transition from one number to another, so it can be used for things like BackgroundTransparency, Position, Size, etc. |
|
|
| Report Abuse |
|
|
Wowgnomes
|
  |
| Joined: 27 Sep 2009 |
| Total Posts: 26255 |
|
|
| 24 Aug 2015 01:58 PM |
I use math formulas lol
Just make your own |
|
|
| Report Abuse |
|
|
Cleverish
|
  |
| Joined: 19 May 2013 |
| Total Posts: 314 |
|
|
| 24 Aug 2015 02:00 PM |
| @Gnomes, I can make my own, I'm just confused on how to implement the total time it takes to tween into all of it :/ |
|
|
| Report Abuse |
|
|
rayk999
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 4705 |
|
|
| 24 Aug 2015 02:00 PM |
Look in my models
rly kool kat modules
I have a module which was mainly there for cframe interpolation but it'll work just as well for numbers
|
|
|
| Report Abuse |
|
|
|
| 24 Aug 2015 02:00 PM |
| (maxVal/maxPercent)*Percent |
|
|
| Report Abuse |
|
|
|
| 24 Aug 2015 02:00 PM |
Then use a foor loop
Or even better be a scrub and still use that tweenfunction
local fake_gui = Instance.new("TextLabel") fake_gui:TweenPosition(UDim2.new(1,0,0,0),'Out','Quad',1,true) fake_gui.Changed:connect(function() true_gui.Transparency = fake_gui.Position.X end)
|
|
|
| Report Abuse |
|
|
rayk999
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 4705 |
|
| |
|
|
| 24 Aug 2015 02:02 PM |
I never did what i just said but i think it'd work lmao
and then you can still use "Quad","Bounce" and what to ur "tweened" numbers |
|
|
| Report Abuse |
|
|
rayk999
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 4705 |
|
|
| 24 Aug 2015 02:05 PM |
local function lerp(n1, n2, a) return (n1+((n2-n1) * a)) end |
|
|
| Report Abuse |
|
|
EvanHolt
|
  |
| Joined: 06 Sep 2008 |
| Total Posts: 1264 |
|
|
| 24 Aug 2015 02:05 PM |
Tweening between two numbers:
local current = 0 local totalTime = 0 local start = 53 local end = 127
for i=1, math.abs(end-start) do if end > start then current = start + i else current = start - i end wait(.001) end totalTime = .001 * (end-start)
[ George Orwell taught me math! 2 + 2 = 5 ] |
|
|
| Report Abuse |
|
|
Cleverish
|
  |
| Joined: 19 May 2013 |
| Total Posts: 314 |
|
|
| 24 Aug 2015 02:09 PM |
How does this look?
local a = 10 local b = 30 local t = 2 for i = a,b do print((b/(b/a))*i/10) wait(t/(b-a)) end |
|
|
| Report Abuse |
|
|