Download

Timelines for movement behaving strangely

Ok so I’m working on a sort of medical museum in Unreal Engine and since it’s going to be used by some people who don’t know games I want to have an “accessibility mode” where they can look at an exhibit or door and click and be taken to that point. I’m doing it currently by having hidden cubes that encapsulate each exhibit to trace look at and then a null point to actually move to. Since the player might be farther or closer to the exhibit they want to see, I’m calculating the distance to that object and dividing the result to generate a number roughly between .1 and 1. My timeline for the motion is a linear 1 second, so the animation time to an exhibit would be 1 to 10 seconds. The problem I’m encountering is that the player/camera is moved to the exhibit relatively quickly, but the timeline doesn’t finish playing until awhile later. So if the play rate is .5 it should take 2 seconds to get to the exhibit. It takes a bit less than that, but the timeline just keeps playing through the full time. The slower the play rate the greater the discrepancy. For a .1 play rate it might take 3 seconds to get there and then have 7 before the timeline officially ends. Anyone have an idea why that happens? Thanks!

Here you can see my player blueprint where I’m calculating what he’s looking at, at well as the distance to that point:
fb6dde314579401877466cb34a2de63867b40afa.png

Here you can see one of the ‘animate to’ pieces for a single exhibit. The timeline works as an alpha from 0-1 over 1 second to lerp to the new spot, then it continues on:
4e7565658e4435298a70917112aad8966328af4c.png

Nvm, I figured it out! By pulling the player location on every frame it was exponentially increasing the movement rate over the course of the animation. I changed it to set a variable with the location on click and use that to lerp with the nav target. Works like a charm! :slight_smile: