Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some players are not detected #62

Open
mesl opened this issue Mar 25, 2023 · 10 comments
Open

Some players are not detected #62

mesl opened this issue Mar 25, 2023 · 10 comments

Comments

@mesl
Copy link

mesl commented Mar 25, 2023

Using the latest version of ZonePlus, I noticed that when some of my friends join the game, Some newer accounts don't fire the playerEntered (in their localscript) event, I havent figured out why 100% yet because I have trouble reproducing the issue, But it could be related to a longer UserId?
Here's how I Managed to reproduce this issue a few times:

  • Join A server with ZonePlus in a localscript that will print something whenever a player enters
  • Have your friend join the same server as me, My friends userId is: 4151523582

If I walk into the zone, The value prints for both me and my friend
If my friend walks into the zone, The value will sometimes print for me but not print for my friend
If I then leave the game and my friend tries again after I left the game, The value will print for him

I hope this is enough information, I havent completely figured out how to reproduce this as of now

@mesl
Copy link
Author

mesl commented Mar 26, 2023

I've been able to isolate this issue further, I haven't been able to replicate this on an alt-account that also has a long userId, so i doubt that is the issue, I've been able to replicate it with userId 4151523582 pretty consistently, The following is what seems to happen:
The character does not get detected by the zone at all, The event does not fire
The character doesn't need to have a friend in the server, If the player is alone the bug will occur as well
The bug seems to happen on a 50/50 chance, if the bug does not happen, relogging will usually make the bug appear, vice versa, having the bug and relogging can make it disappear
Sometimes if a friend joins and walks into the same zone, The player gets detected afterwards

@mesl
Copy link
Author

mesl commented Mar 26, 2023

I added print statements where zoneplus adds a player and a character, Both of these do get printed from the bugged players perspective with their name
I also added a print statement whenever an event is fired internally in the signal class (line 153-154) and this does not fire here either
I also added print statements in the Zone class at line 394 in _updateOccupants
Printing an table.unpacked previousOccupants will always return empty, unless another player walks into the zone, then it returns their name
I also print the line before table.insert(signalsToFire.entered, occupant) for both entered and exited, These do not fire with the bugged player either

@mesl
Copy link
Author

mesl commented Mar 27, 2023

I think I have figured out whats causing the issue, I copied all important scripts from my place into a testplace and the zone detection worked there at first (even with the userId 4151523582) But then I realised I delay character loading because of a loading screen and a main menu, So I added an artificial delay to loading in the characters (By disabling autoload in the playerservice and connecting to playeradded in a serverscript on which I wait 5 seconds before loading the character)
Doing this made the zone detection stop working for userId 4151523582 but is still working on my main

@mesl
Copy link
Author

mesl commented Mar 27, 2023

ZoneDetectionBug.zip
Here is my testplace, Keep in mind that it doesnt seem to occur for every player, also keep in mind that even with the UserId I specified before, It doesn't occur 100% of the time

@mesl
Copy link
Author

mesl commented Mar 27, 2023

I have temporarily fixed it by changing the FindFirstChild(X) to WaitForChild(X, 3) in
function Tracker.getCharacterSize(character) for both Head and HRP

@NorteX-dev
Copy link

This is still an issue and the temporary fix mentioned above does not work, at least not long-term.

@mesl
Copy link
Author

mesl commented Apr 14, 2023

It's indeed more of a bandaid, not a fix, Which is why I haven't marked this as closed yet

@NorteX-dev
Copy link

It's not even a bandaid for me though. For me the detection is still random, about 50/50 between sessions, so it's safe to say nothing has changed for me. Maybe you found any other clues in the 3 weeks since the original was posted so I could try and find a fix?

@mesl
Copy link
Author

mesl commented Apr 14, 2023

Since it only happens to some players and isn't 100% reproducible its very hard to say, However I realised that If i delay character loading (By loading the character in manually after a couple seconds) it seems to happen more often, Because the waitforchild 'fixed' the issue for me, It might be related to the different packages' heads?

It was also easier to reproduce in my game, which does a lot of things before loading in the player compared to my test-place, which waits and loads in the player, I don't really know why, but it might help to be aware of this (While in my main place, I could rejoin and 3/4 times I would encounter the issue, in my test place that was more like 1/10 times)

@6ixfalls
Copy link

Can you check if the fix in #41 works for you on default accuracy?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants