#Weird jitter issue when making enemy ai chase the player (lags behind)

1 messages · Page 1 of 1 (latest)

sand zodiac
#

Hello, my enemy, if it has a higher walkspeed than the player, can never visually catch up to the player because it lags and jitters behind. However sometimes it still deals damage.

I've been told that on the server this doesn't occur, and in reality the enemy is much closer to the player than on the client, however how do I even fix this? It is such a large issue that I cannot just overlook it within my game.

I've heard of setting network ownership to the player, but that enables way too many exploits and bad things that can destroy the game.

Anybody please help! This is very detrimental to my entire game concept!

sand zodiac
#

any help appreciated

bleak ivy
# sand zodiac any help appreciated

Hey! This happens because on the client, the enemy’s position updates are replicated from the server at a lower rate, so it looks like the enemy is lagging or "jittering" behind. On the server, the enemy is actually closer and can still hit the player.

The reason you see this visually is because the client doesn’t get perfectly smooth updates for fast-moving NPCs.

sand zodiac
#

yeah that makes sense tbf

#

in the end i had to like use networkownership and then pathfinding

#

i managed to fix it but i forgot about this post so i will mark it as solved