Lag Compensated Projectiles

First of all I just wanted to say thank you for taking the time out to read this.

So I’m having a problem as to how I could create Lag Compensated Projectiles. I’m currently using Bolt Networking which allows me to rewind up to 60 frames (1 second back in time). Although I’ve been looking at this asset which allows me to rewind back further and use my own hitbox system (Net Rewinder | Network | Unity Asset Store).

What the Bolt Advanced Tutorial shows is when I shoot, I send to the server the frame I shoot on, and the server rewinds the hitboxes back to the frame and casts a raycast. This works perfectly for Raycasts, but what about projectiles? I tried to look for the methods used in other games (like Battlefield), but I can’t seem to find any.

What I have for my projectile script is this:

 public float speed = 10;
public float gravity = -9;
public Vector3 oldPos;
public Vector3 newPos;
Vector3 direction;
Vector3 velocity;
Vector3 force;
float distance;
private void FixedUpdate()
    {
        velocity = speed * transform.forward + force;
        force += new Vector3(0, gravity, 0);

        newPos += velocity * Time.deltaTime;

        direction = newPos - oldPos;
        distance = direction.magnitude;

           RaycastHit hit;
           if (Physics.Raycast(oldPos, direction, out hit, distance, ~ignoreLayers))
           {
             Destroy(gameObject);
           }
           else
           {
             oldPos = transform.position;
             transform.position = newPos;
           }
    }

What is the reason you want to rewind back more than a second? Chronos comes to mind for something like that.

It’s not that I want to rewind back for more than a second, unless I have to that is. I’m just interested in understanding the bullet drop / travel techniques

Alot of games do independent simulation with the same start values synced. I.e pos,rot and vel