|
| 08 May 2014 01:44 PM |
You can already use TweenPosition for Frames and other Gui-related Objects.
Example: game.StarterGui.TestGui.Frame:TweenPosition(UDim2.new(1,1,1))
There is also TweenSize. game.StarterGui.TestGui.Frame:TweenSize(UDim2.new(1,1,1))
If these were able to move Non-Gui Objects(Parts/Models) it would be very useful.
For example, The script would look something like this:
game.Workspace.Part:TweenSize(Vector3.new(1,1,1))
or
game.Workspace.Part:TweenPosition(Vector3.new(1,1,1))
- So, what do you think? |
|
|
| Report Abuse |
|
|
|
| 08 May 2014 01:45 PM |
- Bump
[Any Replies]
[[Someone Reply]]
|
|
|
| Report Abuse |
|
|
| |
|
|
| 08 May 2014 03:58 PM |
| No you a loop for that, tweening is for GUI only. |
|
|
| Report Abuse |
|
|
| |
|
|
| 08 May 2014 04:04 PM |
| It's a relatively good idea, but sadly there is no method that I know of. |
|
|
| Report Abuse |
|
|
|
| 08 May 2014 04:09 PM |
| This is an idea. I didn't post it in S&I cause few people will know what I'm on about. |
|
|
| Report Abuse |
|
|
jobro13
|
  |
| Joined: 05 Aug 2009 |
| Total Posts: 2865 |
|
|
| 08 May 2014 06:45 PM |
We basically have this - Vector3 lerp.
function TweenPos(part, endp, time_s) local start = part.Position for i = 1, time_s*60 do part.Position= start:Lerp(endp, i/(time_s*60)) wait(1/60) end end
|
|
|
| Report Abuse |
|
|
|
| 09 May 2014 08:23 AM |
"wait(1/60)"
Why do this if scripts run every 1/30th. of a second? |
|
|
| Report Abuse |
|
|
jobro13
|
  |
| Joined: 05 Aug 2009 |
| Total Posts: 2865 |
|
|
| 12 May 2014 02:28 AM |
| Actually, wait(1/60) is implemented now, as roblox has increased from 30Hz to 60Hz. To wait one frame (1/60) you need to explicitly wait for that, otherwise some games will work "twice as fast" |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
|
| 12 May 2014 05:30 AM |
Which is also why you shouldn't do that. It's inconsistent. And you also shouldn't be changing the position. Here's how you do it properly:
function tween(part, B, time, f) local A = part.Position local t = 0 while t < 1 do t = math.min(t + wait(1/60)/time, 1) part.CFrame = (part.CFrame - part.CFrame.p) + A:lerp(B, f(t)) end end
And then you call it like:
tween(workspace.Part, Vector3.new(0, 50, 0), 5, function(x) return x*x end) |
|
|
| Report Abuse |
|
|