So server creates NPC in script. Then on client i want to move this NPC, but the thing is that it will take a couple of seconds to start moving NPC. I’m 100% sure its not my scripts fault as i tested it and when i do Humanoid:MoveTo() it prints, but NPC don’t move.
So i guess this is problem with Server <-> Client replication.
Well… When i made it i thought that i can create NPC on server and move it on server too, but then i noticed that its not smooth. So i decided to remade it so NPC will move on client and then FireServer to let server know player touched that, but heres the problem i got…
The thing about that server won’t see changes really don’t matter, i just create NPC there so they will appear for every player
what do you mean by not smooth exactly? I don’t see why there would be any issues with a humanoid moving like that. Have you tried using the command bar to see if it looks smooth then? in case it does it would be an issue with your script most likely
There no problem with my zone system as i tried printing when player enters zone and it printed. Then i tried to add print near Humanoid:MoveTo and it printed too. So there no issue with my code.
well if you are creating an npc on the server, and moving it on the server then the only cause for the delay could be the script itself. There is no replication delay when everything is on the server.
why? If you want npc movement to be clientside, then just create it on the client? Also why are you moving it on the client? You want the slime to follow each individual player?
First thing i thought is that i will just create NPC on server so everyone will see it and then move it on each client individually so movement would be smooth. Then when i need i just delete the NPC on server and he will disappear for everyone.
On client i loop through all Zones and for each zone loop through all players and check if any of them inside that zone. If at least 1 player inside - move NPC to him
if you just FireAllClients all the players will see it as well. If you move it on the client then 1 slime can follow any number of players, not sure if this is what you want. This would also mean all the other players can’t see them thus it will look to others like the player is running from nothing. If this is not your intended behavior then i’d recommend switching to server. Also here is where Zones+ V2 would come in handy as you would not need to loop through but connect it to player enter zone events. If you want it to be on the client then just go full client, why bother with replication and latency.