As Dan Hulme points out in a comment, the variable
last is not updated each frame. Assuming this code is within a function, it is initialised to the current time once, the first time this function is called. Every time the function is called after that, the
static keyword prevents the
last variable from being updated. This variable therefore remains unchanged throughout the animation, always set to the initial time.
If this suspected problem is indeed the case, you can correct it by either not using static variables, or by initialising the static variables and then separately updating them in lines that do not contain the
In the current code, I can't think of a way that
last could already be set to the current time each frame unless there is more code that has not been posted, in which case we will not be able to help you without seeing it.
There are more subtle problems with simply multiplying by delta, which will give a different trajectory for different delta sizes, but they may not be relevant depending on the accuracy that you require. I have focused on what appears to be the most significant problem, as nothing else can be tested until that is either addressed or proved to be not a problem.