Teleporting instead of Panning, is this a bug or am I missing something?

A Bit new to Unreal, from my previous question, i started using Interp To, to try and move the player character. However, while using VInterp to try and move the player forward, it teleports the player the distance instead of panning them the distance smoothly. And if I set the system to use the delta seconds from the Tick event, the teleport doesn’t go the full distance between the two locations.

When i look up a tutorial on how to use, i can only find tutorials for Unreal 4 not 5. And show that the way i have set up the VInterp To should work. However, I’m not sure if there’s been some kind of change between 4 and 5, to make this no longer work?


Here is what the blueprints look like.

It must be called every frame - that’s how interpolation works, it relies on the intermediate result. And you need to sample the current location, too:

If you’re interested in the Time it takes to go from A->B, consider looking into Timelines.


In depth:

1 Like

Thanks for the suggestion, however, it doesn’t really fix the issue I am experiencing. The Delta Seconds I am using are taken from the Event Tick so it is using every frame. However, whenever that is plugged into the system The VInterp To doesn’t go the full distance to the Target.

I have updated it to take the Player’s active location. However, the player still teleports between the Current and target distances. And with what you have sent, and videos showing Interp, Says that it should smoothly Transition not 1 frame teleport. Which it does do, even with Event Tick’s Delta Time.


Just to quickly explain, the player should be able to press a key to move forward, to a present location, and then another to return to their base position. There already is a similar situation that functions wonderfully with Finterp To

So I don’t know if I’m unaware if VInterp To has been changed, but from my understanding it should work the same as FInterp To

Edit: Just a quick edit in case I misunderstood what you first said, i have also hooked it up to the Event Tick and experienced the same issue, with it suddenly teleporting first Tick.

Try it the exact way I suggested. Nothing has changed. fInterpTo works the same as vInterpTo


the player should be able to press a key to move forward, to a present location, and then another to return to their base position.

Player input should open a Gate for Tick to interpolate results using delta time.

Just a quick edit in case I misunderstood what you first said, i have also hooked it up to the Event Tick and experienced the same issue, with it suddenly teleporting first Tick.

Sounds like you manually punched in delta which is time between frames - 50 makes absolutely no sense whatsoever in this contenxt. Use this for now:

image

And update the script on Tick.


Consider the following:

Here, the Gate is optional but I assume you will want to shut down the interpolation at some point and closing the Gate would be one way to do it.


move the player character

A good question here is why we’re using this method for player movement. It overrides all the goodness the movement component provides. This could be OK if you were moving chess pieces but characters have their own movement methods - that’s what input vectors, AI and navmesh are for.

Hard to advise without knowing what the overarching goal is, ofc.

1 Like

Thanks for the help, I didn’t understand that the alterations needed to be plugged into the Event Tick. And the reason why I’m locking movement is for a horror game, it’s for restraining movement which is why I’m making a hard coded movement without a lot of control. You honestly made a better blueprint than i ever could of. :melting_face:

In case you find Tick + vInterpTo combo eventually lacking, consider a Spline + Timeline - this will allow you drive any actor along any path shape with as much fidelity as you desire. And also control timing.


To make it even better, have the player character possessed by an AI controller, and drive a dummy along a spline the AI must chase.

Good luck!

2 Likes

Thank you for the suggestion, I’m using InterpTo because during my previous question, I was told to try using InterpTo instead of Timeline. For an Error i was experiencing previously.

I just wanted to add that if you want to Tick for X time, simply take the delta seconds and divide it by a variable called “SecondsToComplete” and that will give you the correct value to make your Tick take whatever value you put into “SecondsToComplete” before it gets to 1.

TickOverTime

So in this scenario, rather than using InterpTo, I would use a lerp and take the DeltaSeconds % 5 to make it take 5 seconds to lerp from A to B.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.