Using VInterpTo not in the Tick event or in a Input Axis event

Hi!

If I want to run this piece of code:

But, I don’t want to do it inside the Tick event or as a response of an Input Axis event, what do I have to do?

I’m thinking in a situation where the player press a key, as an Input Action, and then, the actor moves.

Thanks!

1 Like

Any InterpTo node pretty much needs to be called constantly until the actor reaches its destination.
An alternative would be using a Timeline and a Lerp node to interpolate between the initial location and the target location, but you’ll have to additionally calculate for the distance so that the actor would move with the constant velocity.

3 Likes

@Tuerer I remember that I have seen a code to do it without using Tick event or Input Axis here in the forum, but I don’t remember where. This is why I’ve asked.

1 Like

If you have the interp speed set to 200, you can just use SetActorLocation.

1 Like

@ClockworkOcean Thanks but, i’m not asking: if I’m using 200 of Interp speed, can I just use SetActorLocation?

I’m learning and I’m trying with different values of speed to see what happens.

The piece of code it’s only an example and it doesn’t represent EXACTLY what I’m asking. I’ve added to show you that I know how to use VInterpTo.

Maybe I have to add a disclaimer.

1 Like

Ok, but why avoid using tick?

1 Like

@ClockworkOcean

1 Like

The question still remains. Why put yourself through this hardship, there’s nothing wrong with tick.

Tick gets a bad reputation all over youtube, because people who don’t know what they’re doing hang rubbish code on it. I really think the node should be unavailable for the first six months using the engine :slight_smile:

2 Likes

Was it perhaps an interpto component?

I’m sorry, but you are not answering my question.

I’m asking if there is other way to use VInterpTo without using the Tick event.

This is probably not useful for you any more in 2023 but yes, there are lots of ways you could use InterpTo nodes without using tick, there’s just not good reason too.
You could trigger it from any event in blueprint (or in code if you want) but you will still need to provide it with a DeltaTime value regardless or it will do nothing. DeltaTime is just a float value, so you could get it from anywhere. If you want drive the interpolation forward using some game event instead of the clock, you could just try that and see that it works (at least I’m pretty sure it does).
But that’s not what that node is for: it’s for smoothly moving between values on Tick. I understand it’s pretty light-weight too so again, no reason to do otherwise.

1 Like

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