How to get speed from timeline movement
Hi, I have an object that moves up and down by using a timeline, now I have to get the speed of the object so I can use this speed to move other objects. In the blueprint I used a math equation to calculate the speed, I have the displacement in Z and I divide that by delta seconds. But now for example like you can see on the picture, I have a displacement of 30cm which results in a speed of 1800. But this isn't correct because the object moves from 0 to 30 cm in 0,5 seconds. So how can I get the right speed from the object?
asked Mar 14 '19 at 02:31 PM in Blueprint Scripting
That because you have to multiply by Delta Seconds, not divide by it. Delta Seconds is time betwen two frames, so its value is 0.01 or something like that.
Edit: note that if your actor moves not uniformly, but eases in/out, the velocity that you'll get by multiplying distance by Delta Seconds won't always reflect the true velocity, just average between those points. If you want to drive something else by feeding this velocity value into it, it may be not reaaly what you would expect. Can't you move the other objects with the same Timeline?
Follow this question
Once you sign in you will be able to subscribe for any updates here