well the solution was just switching to spines specifically nurbs (non-uniform rational B-spline) also known just as a b-spline where i created a module for myself, I don’t plan on open sourcing it but i bet you could just search for it online and something will show up!
edit:
yeah there is a few open sourced spline modules if you just search em up.
Sweet, I get to create lines from different points, I hope. I’m going to be trying this module for VFX work for sword slashes real soon to see if it’s even possible. Thank you for this resource, man.
Such an awesome module, currently using for Blader’s Odyssey development.
One major issue I had with the module, however, and that I had to manually fix within the module’s code is that when you use BaseParts as a BezierPoint, the connections for it when you call CreateCFrameTween() or CreateVector3Tween() don’t clean up, even when the tween has finished and there is no need to call :UpdateLength() when the part’s position updates, causing massive lag over time if the BasePart still exists and moves around. For example, a projectile attack creates 50 projectiles that Bezier home onto a Character’s HumanoidRootPart, but when the tween has finished, the connections don’t clean up, and since the Character’s HumanoidRootPart still exists and is moving around, the UpdateLength() is still firing every single frame multiplied by the 50 Beziers that are created, whilst there is no need for the Bezier to exist at this point and everything is cleaned up.
The solution was just to loop through the Bezier’s ._connections table and Disconnect the :GetPropertyChangedConnection() connections when the .Completed event of the tween fires.
Went crazy trying to figure out why the framerate would drop to 10 after the special attack, as the last place I thought to check was the module itself.
Oh, this is a really good point. Though your changes will fix the issue, this issue goes deeper than just the tween function. I completely forgot to add a destroy function for the Bezier curves.
So even if you create Bezier curves that aren’t used for tweening, they will continue to update based on the changed events of the parts used to create the curves. This is definitely a memory leak I need to fix. I’ll make sure to add a destroy method for the Bezier curves soon.
With the destroy method, all you’ll have to do is make sure you add a listener to the Completed event of the tween you get.
local tween = bezier:CreateCFrameTween(object, propTable, tweenInfo, relativeToLength)
tween.Completed:Connect(function()
bezier:Destroy() -- this is the method i need to add
end)
Thanks for pointing this out! I’ll add a fix to this issue when I have time
Heya, I love the module. One thing I want to know though, how would I go about updating the point positions. I do understand it’s “Bezier:CalculatePositionAt(t)”; however. Can you give an example of how to calculate “t” without visualizers as shown in the example?
Kind of like a part homing in on the player. (The player moves of course.)
Just wondering: Is there a way to create a closed loop, and is there also a way to find where the closest point on the curve is to a specific Vector3 value?
Users beware. Major leak issue with this module. Only usable if you implement the fix mentioned by @aaronvtran or implement your own destroy function. Other than that, it’s great.