Vinterp on moving target

Hi,

I use the vInterp node to move my pawn on an object. It works well if my target object does not move. But my objects can move at different speeds. It works rather well if the speed of my object remains relatively low, but if my object is rather fast, despite the fact that I update the position of the target in each tick, my pawn only follows it from a distance without join it.

An important point, I can not change the speed of interpolation, the movement speed of the pawn being an integral part of the gameplay.

My first idea was to attract the player to this object once close to him, but it gives a rather ugly result visually.

Do you have any ideas to work around this problem and have a smooth moving result regardless of the speed of the target object?

Thank you for reading.

perhaps I misunderstood the purpose… but it does kind of seem like normal behavior…

if the interpolation rate is fixed then if the target object is moving slowly than the player will catch up. However, as the target object goes beyond a certain speed the player won’t catch up and will fall further and further behind.

Perhaps part of the issue is: I don’t think that the movement speed of the pawn is quite the same thing as the interpolation speed…

To be honest, it’s first time i use vinterp node. And i guess you understand my problem. I agree, it’s logic and normal behavior.

My pawn can not move other than by a click of the user on an object. And, to keep it simple, I stupidly used the interpolation speed as the speed of movement of the pawn.

If this is the wrong way to do it, how to manage a speed of movement independently of the interpolation speed?

I have this for now :

here is the issue I think… the actual movement site of your loan seems like it will vary quite a bit…

If the location of your cursor and your pawn are far apart, the pawn movement speed will be higher… and vise versa. Actually, I’m not entirely sure but you can use the Get Velocity node with print string to chech what I’m saying.

If I can just ask, are you doing like a “click for actor to move to location rpg” ? or is it more like “move puzzle piece to cursor”?

The get velocity node seem return alway 0,0,0. but you are right for speed based on distance to target. If target is far pawn position, the speed is higher than if it near. The speed is down when pawn approach the target. it’s clearly visible without measures

It’s more like rpg move by click, i dont use character class, just base pawn, so without movement component (maybe wrong way). Player start on an actor, and can move on other actors by clicking on it. I want to be able to manage the speed between two actor (like, more you have level, more you can move fast). and able to reach moving actor at different speed in smooth way and (the problem) if it possible regardless of pawn speed.

To be clearer, the speed of the actors must not penalize the possibilities of displacement while not changing the speed of movement of the pawn.
Maybe not possible, cause the logic want you cant to reach object if speed faster than you…

By the way, sorry for my approximativly english !

Your English is excellent… you should be very proud :slight_smile:

I think if you are aiming for a full rpg click to move with varying landscape and varyingly accessible areas… Id use an entirely different approach with a full character movement component and navigation mesh. This way you have control over where your character can go, set movement speed, acceleration which can vary easily according to your characters level.

By the way, here is how get velocity now works, combine it with vector length node to get… you might also use get physics linear velocity node … Get Velocity | Unreal Engine Documentation

I have add a “Floating Movement Component” to my pawn. Now in my tick, i get the direction of a target in each tick, and i add input movement toward target. I can manage the max speed, acceleration and desceleration of the pawn. The problem now is, when i reach a moving object, the pawn oscillates around him.

I think i just need to check the distance between pawn and object, and reduce the speed for stabilazes movement

Yes, a floating movement component might serve your purpose: if you don’t NEED a full character component and navmesh it would certainly be more efficient to do it your way.

If your pawn and object have collision, the reason your pawn is circling around it is because they are trying to occupy the same position but prevented from doing so. You could add an overlap or collision event, which turns off the input movement when it occurs… or as you say get distance between actors (there is a node for this) and turn off input movement when it is below a certain threshold.

I dont have collision. I think the issue is my target is moving, and on each tick, i have an add input to adjust position. The cycling is probably due to acceleration setting. My input is maybe too strong

The best result i get for now. It’s pretty ugly, but i need more sleep… Or more cofee, as you wish :stuck_out_tongue:

I like sleep and coffee… both great!!! :slight_smile: The BP looks decent, but it maybe there are two issues…

  • the bool isMoving never changes value (but maybe it happens elsewhere)
  • either way, after the distance test… the player moves towards the cursor… it’s just using two different techniques

Right, IsMoving is useless now, Instead of that, i have now isValid for “CursorTarget”.(Always setting after first click).

I add a VInterp node cause if i dont, after distance test i experiencing clipping when the player follow the target. Something like “lag effect”. With VInterp, when the player is close to object, object attract him and follow the object in smooth way.

I make some test with speed management, but i dont figure out how it really work. In example, if i speed up the pawn (max speed to 3000 or something like that), he never catch the object, only describe elipse arround him, and the same thing happens on static object if player go from moving object.

I guess it would be better if you could drop the Vinterp and rely on the Floating Pawn Movement component to meet your aim: because you’d have complete control over speed, acceleration, deceleration and turning traction.

I’m not quite sure why it would be moving around the target in an ellipse… but the first thing I’d try would be to cut out the vinterp and simply add the input to the component and not the pawn itself.

269469-floatingpawn.jpg

I agree with you for control over speed, acceleration and deceleration and turning boost. But, if i just drop the vinterp, i have this “lag effect”. My camera follow the pawn, and the pawn follow object, so, my camera is shaking every tick, cause the add input vector (or add input movmeent) is not really smooth, i dont know why. The effect is very ugly.

Another issue without vinterp is the elastic effect when the object is reached, It’s probably causing by velocity, Deceleration dont seem have effect when i stop the input. So, the pawn exceeds the target, comes back, exceeds the target, comes back, and after 2 or 3 times, it stabilize on the target. i guess i need to do something like reduce acceleration regard of the distance, i have tried some things, but i always have ugly effect…

This movement mode is very hard to grasp :frowning:

What part of setting do you want to see ?

The camera shaking only when the pawn stand on the object.
Yes, i’m sure about collision. The mesh is set to no collision, like the camera and springarm, and my capsule component is set to be ridiculous little (more little than the mesh), and only have custom overlapping setting in collision, all other is set to ignore.
And, my pawn is never in contact with the object stanging on. My object has no collision too.

When the pawn stand on yhe object, i have delay between the object movement and pawn movement. The pawn seem alway move late, so, when the pawn catch the moving object, this object move, i have delay, and pawn move, and when the pawn catch again the object, he move again, and later, pawn follow him… I dont know how to i can explain that better… :frowning:

would you please post a screenshot of your Floating Pawn component settings?

is the camera shaking every tick… even before it comes close to the target? I guess you are sure the pawn isn’t colliding a lot with the landscape for instance…

ok, well the camera and the pawn movement component aren’t causing the jitters… so they are fine… except when the pawn reaches and then continually tries to locate exactly on the target.

would the delay be caused by the pawn movement acceleration setting?

what I’d like to see is the pawn movement control settings for acceleration/deceleration etc. Oh and just in case, maybe double check that the component is active :slight_smile:

Sorry for late response.

Here the Pawn Ffloatting settings.It’s just by default !

269567-pawn-movement-settings.png

If it’s me, I’d put all my movement input to the floating component, and then play with speed /acceleration /deceleration /turning values… put them VERY high to make sure they are working as expected

Then combine this with a brand and a distance between actors node to turn off your input at the right time…