BasePart:TweenCFrame with Velocity support

The issue
Alot of times it’s nessecary to move a brick (or bricks) in a certain direction smoothly.
Wether it be Opening a gate, Animating an unstoppable train or Moving an elevator, it all requires you to move an Anchored part smoothly towards a certain CFrame without being interrupted by other Parts.
It is currently impossible to create such a movement and include correct physics.


Example of when smooth moving operation is needed.

Current solution:

  1. Create a RenderStepped event
  2. Lerp the Brick CFrame
  3. Brick.Velocity = (lastpos - Brick.Position)/dt

Not only is this very CPU unfriendly, it will not create correct velocity if the Bricks CFrame is rotating.
Simulating such physics is currently impossible (setting RotVelocity doesn’t help).

TweenService does not run each Frame, more like 10 times per second. It’s really useless in this matter.
Also it won’t simulate rotational physics correctly either.

Solution
BasePart:TweenCFrame(endCframe, easingDirection, easingStyle, time, override, callback)

Not only would this be able to be optimized (running code outside lua or whatever magic Roblox applies), it would make FE games required to create one less customcode solution for this very common issue.

15 Likes