Isosta
|
  |
| Joined: 10 May 2015 |
| Total Posts: 14729 |
|
|
| 20 Aug 2015 03:45 PM |
tweenJoint = function(Joint,NewC0,NewC1,Duration) local StartC0 = Joint.C0 local StartC1 = Joint.C1 spawn(function() local tweenIndication = nil local NewCode = math.random(-1e9, 1e9) if (not Joint:FindFirstChild('TweenIndication')) then tweenIndication = Instance.new('IntValue') tweenIndication.Name = 'TweenIndication' tweenIndication.Value = NewCode tweenIndication.Parent = Joint else tweenIndication = Joint.TweenIndication tweenIndication.Value = NewCode end local num = 1/(Duration * 60) for i=0,1,num do if Joint:FindFirstChild('TweenIndication').Value == NewCode then Joint.C1 = StartC1:lerp(NewC1,i) Joint.C0 = StartC0:lerp(NewC0,i) game:GetService("RunService").RenderStepped:wait() else break end end if tweenIndication.Value == NewCode then tweenIndication:Destroy() end end) end
FilteringDisabled is for squares |
|
|
| Report Abuse |
|
|
|
| 20 Aug 2015 04:00 PM |
| Yes, you aren't using local variables. |
|
|
| Report Abuse |
|
|
Isosta
|
  |
| Joined: 10 May 2015 |
| Total Posts: 14729 |
|
|
| 20 Aug 2015 04:01 PM |
..
FilteringDisabled is for squares |
|
|
| Report Abuse |
|
|
|
| 20 Aug 2015 04:01 PM |
| It's also dependent on a consistent framerate, which is bad. |
|
|
| Report Abuse |
|
|
|
| 20 Aug 2015 04:02 PM |
| wait ignore my first post i wasn't reading it right |
|
|
| Report Abuse |
|
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 20 Aug 2015 04:03 PM |
"It's also dependent on a consistent framerate, which is bad." like pretty much everything (as everything slows down not just the render process). |
|
|
| Report Abuse |
|
|
Isosta
|
  |
| Joined: 10 May 2015 |
| Total Posts: 14729 |
|
|
| 20 Aug 2015 04:03 PM |
^
FilteringDisabled is for squares |
|
|
| Report Abuse |
|
|
|
| 20 Aug 2015 04:03 PM |
@lord
What I meant was that the way he's doing it, it'll take someone with 30fps twice as long as someone with 60fps to complete the tween. |
|
|
| Report Abuse |
|
|
Isosta
|
  |
| Joined: 10 May 2015 |
| Total Posts: 14729 |
|
|
| 20 Aug 2015 04:05 PM |
@dermon,
that's unfortunate for them.
FilteringDisabled is for squares |
|
|
| Report Abuse |
|
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 20 Aug 2015 04:07 PM |
| Oh, consistent across players. Isn't that what you'd expect from a player that's lagging? Well nontheless, I suppose coroutine.yield() would be better |
|
|
| Report Abuse |
|
|
|
| 20 Aug 2015 04:08 PM |
It's easy enough to calculate alpha based on time.
local alpha = (tick() - startTick) / tweenTime |
|
|
| Report Abuse |
|
|