Locally predicted projectile on MOBA

What is the best way to locally spawn a Projectile and predict the movement locally but later on switch to the real projectile when server replies?

This is called “predicted spawning”, it should be seamlessly handled in Netcode for Entities and we have a doc page on this here Spawning ghost entities | Netcode for Entities | 1.3.6. The NetcodeSample should also have a scene with predicted spawned grenades.

It does works, but movement is not smooth at all

I had a similar issue in the past.

Make sure :

  • the Locally spawned projectile ghost is correctly classified.
  • the projectile movement Job is only running on entities with the simulate Tag.
1 Like