In my game, when I instantiate projectiles, I set all their properties BEFORE parenting them, which USED to work seamlessly, the projectile would spawn and instantly begin moving, but on my recent project which I started about 2 years after the one in which that technique worked, it seems to no longer work, as the projectile will lag for a solid half to full second before moving.
What I tried initially was setting the projectile’s network ownership to the player that created it, but that doesn’t exactly work because many projectiles in the game have scripts inside them that govern the way they behave during physics interactions. This solution works for making it look smooth, but not ACT smooth, an example of this is a pole projectile that has raycast based hit detection to make it instantly stick to any surface it hits. This works seamlessly when network ownership is set to the server, but when set to the client, I believe the server still sees the projectile as a half second behind (because of the initial lag) and as such the projectile will take about a half second to actually register a hit, the projectile basically appears to be a half to full second in front of where the raycast script actually believes it to be, and thus it has this delayed hit effect.
One solution I’ve seen mentioned on the forums is to use remote events to make a projectile on every client, and only on that client, but I’ve tried that exact solution in a past project and it had loads of issues with replication, I ended up dumping way more time into making a bullet simply register a correct hit and administer proper damage than I did working on the rest of the game, besides, the previous solution is so close to working anyway. Is there any sort of way I can eliminate the lag on the server? Why is it happening?