Download

Best way to move a pawn in the following scenario?

Hi.

I was wondering if anyone knew the best way to move a Pawn in the following scenario:

  1. Pawn - not Character
  2. A server (not UE server) sends the X,Y,Z location of the Pawn every second
  3. The Pawn should then smoothly update (move to) the latest position from the server

What I tried that worked the best was using AddMovementInput but that requires a movement vector, not a position. Is there a way to get the input vector from 2 location vectors? Say I have where the Pawn is currently, and where I need to go, can I make a Vector out of those two to supply to AddMovementInput? Or is there a better alternative?

Thank you.

Use those coordinates as the points a and b and make a movement vector from that .

Point A x,y,z
Point B a,b,c

(Point A - Point B). Normalize * ConstMagnitude (any integer) will give you movement in that direction with variable speed as Magnitude