I am currently storing an ever growing series of positions in a table, From the Most recent [1] to the earliest entry [n] I know that the time between registering each of these positons will always be X
To smoothly lerp between them, I am using the Heartbeat element of RenderStepped which gives us a delta time. Using the delta time, knowing that time between positions will always be X, what should I be doing?
Code looks like this;
totaldt = totaldt+dt--/X if totaldt > X then--if its over the deisred amount, we don't need totaldt = X-totaldt -- gives us a number thats <0> end if pos~=positions[1] then --If we changed our first entry (shifted all by one) pos=positions[1] total = X-totaldt end local t = totaldt/X -- exists between 0-1 (or slightly outside, but never massively.)