Well unfortunately this will not work for me. Let me explain in a simple long form
Lets say we have 3 points, 1 at bottom, 2 in middle and 3 at top.
We define a tween that makes movement between point 1 and point 3
However when i update the tween while its playing, the tween will start making movement between point 2 and point 3.
Replicating this issue turns into the issue i have with the tween from the post
I need a different solution
It’s a bit hacky, but try to fork BoatTween (in community resources) to call a function each time it needs data. This way you could do something like this:
local BoatTween = require(anywhere)
local CubicBezierFunction = "EaseOutExpo"
local Goal = {
Position = WHatever you want
}
local Time = 5
local function retriever()
return {CubicBezierFunction, Goal, Time}
end
BoatTween:Create(AnyObject, retriever)
--change the animations bezier function after 2 seconds of running
--this works because the forked BoatTween module calls the retriever function
--to get data each time it needs it
task.wait(2)
CubicBezierFunction = "EaseInExpo"
Im not sure what this script does and it doesnt really seem like what i need. Although i think the BoatTween will come inhandy.
Im just gonna give more details about what i need:
I basically need to change the speed of a tween while its playing after i change a number value in replicated storage.
It changes the data of a tween (speed, goal, easing like quint, linear). This changes the speed based on your objects value:
local BoatTween = require(anywhere)
local Object = game:GetService("ReplicatedStorage").Object
local CubicBezierFunction = "EaseOutExpo"
local Goal = {
Position = WHatever you want
}
local Time = Object.Value
local function retriever()
return {CubicBezierFunction, Goal, Time}
end
BoatTween:Create(AnyObject, retriever)
Object:GetPropertyChangedSignal("Value"):Connect(function()
Time = Object.Value
end)
Just BoatTween:Create(...).Play(). The code automatically updates the time based on the NumberValue. Just remember, you’d need to fork the module to provide this functionality.
Ok i tried running your code and changing tween time doesnt work.
Now when changing the time from the GetPropertyChangedSignal event, does the time relate to the defined variable, or the variable from the boat:Create.
Just gonna note that i had to avoid using the retriever function because when using it, the tween does not play for some reason
It won’t, you have to make a forked module for it to work. Plus, the retriever function is the only way I think without using external modules to change tween data while an object is animating.
It may be of use to control speed using cubic-bezier curves instead. Check out https://easings.co/ to test cubic-bezier animations.