How can i fix movement delay in my game?

hi, so i was developing my game when i realized there was a noticeable, very annoying player movement delay. since im a beginner scripter and have a very unoptimized, unethical way of scripting, i think my scripts are the problem, but i have no idea which one it could be. because of this, i wont provide any scripts right now, (i have like 20 scripts, so itd be a rather lengthy post) but if i am informed of what could be causing the problem, i will provide any script that may be related. i checked all while loops in my scripts and they werent the problem, the network owner is set to nil, so i really dont know what the issue is. please help

6 Likes

If the network owner is set to nil, then it’s set to the server which would explain the lag. You may have mistakenly placed a :SetNetworkOwner(nil) somewhere in your game that is setting the ownership to the server.

2 Likes

however, if i dont set the networkowner to nil, then that causes even more game-breaking problems, specifically with humanoid:move(). any workaround or fix? should i show my script that uses this function?

1 Like

you can’t control a player’s ping sadly

1 Like

Okay well, what is the problem happening with Humanoid:Move()? Usually this function is only used by the client’s control script.

i am making a 2D game, but i dont know any way to disable walking forwards and backwards on mobile, as sinking the playeraction for those doesnt work on mobile. so, i made my own “thumbstick” (and jump button so it doesnt stick out like a sore thumb) which is really just a frame with 2 buttons that allow you to either go left or right. right now, i only have the left button coded, but it uses humanoid:move() to move the player left, so yeah

i tested my game on 2 devices, one significantly better than the other. there was no difference. also, it only happens with my game

1 Like

did you actually check the ping and fps?

and try to connect to a different network to see if it’s actually different

the default mobile buttons walk and jump doesn’t set NetworkOwner to nil because it makes the player’s character lag when walking or jumping due to internet latency/ping from client to server

topic

i have migrated this topic to a different one, as i think itd make more sense to just stop using setnetworkowner(nil) and try and fix the humanoid:move() problem instead

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.