Pawn replicated movement 'jittery' for clients

I’ve attempted my own pawn smoothing logic for clients, which works pretty well:



//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
// Pawns tick event
//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
simulated event Tick(float DeltaTime)
{
    local vector newLoc;

    super.Tick(DeltaTime);

    //My attempt to smooth pawn location on network games.
    if (Role < Role_Authority && !IsLocallyControlled() && !bPlayedDeath) {
        if (PrevTickLocation != vect(0,0,0) && Physics != PHYS_FALLING) {
            newLoc = VInterpTo(PrevTickLocation, Location, DeltaTime, 10);
            newLoc.x = Location.x;//We only want to interp the z axis.
            newLoc.y = Location.y;
            SetLocation(newLoc);
        }
        PrevTickLocation = Location;
    }
}


Seems very odd that there isn’t something in the default engine for this though…

2 Likes