ZonePlus icon indicating copy to clipboard operation
ZonePlus copied to clipboard

[Bug] Players with an applied HumanoidDescription do not fire player events

Open 6ixfalls opened this issue 3 years ago • 10 comments

Hey! I recently spent a while debugging why my code wouldn't react to the playerEntered and playerExited events, and after a bit of digging, I found out that when I applied a HumanoidDescription to the player, the player was not recognized by any zones on the server (possibly the client too).

A repro game is linked below: https://www.roblox.com/games/8699903286/ZonePlus-Repro Comment out line 15 in CharacterSetup in ServerScriptService to make the zone work again.

This bug is reproducible on the latest version of ZonePlus, v3.2.0.

6ixfalls avatar Feb 01 '22 05:02 6ixfalls

Hi sixfalls, thanks for the repo place! I've played around at the place for a bit and even when trying different start packages, delaying the morph, repeating the applying of different descriptions, it still appears to work fine for me. Are you happy to provide a video or some images with further details? Thanks!

1ForeverHD avatar Feb 07 '22 13:02 1ForeverHD

I can send a clip later; it doesn't work no matter what packages. It could possibly be a beta feature I have on?

6ixfalls avatar Feb 07 '22 15:02 6ixfalls

Would it be alright for you to try the same thing at the repo place but on an alt or new account? You might be right about it being a beta feature or a certain studio configuration.

1ForeverHD avatar Feb 07 '22 16:02 1ForeverHD

Looks like it's just the headless head that makes it not fire; I did some testing and it works fine when I don't have headless equipped.

6ixfalls avatar Feb 08 '22 00:02 6ixfalls

Bug is reproducible with all beta features disabled, here's a video: https://streamable.com/54of83

6ixfalls avatar Feb 08 '22 00:02 6ixfalls

What you mean specifically by headless head? The Headless Horseman head body part for example, or literally no Head instance within the character?

https://thumbs.gfycat.com/SeparatePointlessHomalocephale-mobile.mp4

1ForeverHD avatar Feb 08 '22 14:02 1ForeverHD

The headless horseman head, which you can equip on the avatar shop. I'll try to update the repo place to use a custom avatar with headless.

6ixfalls avatar Feb 08 '22 15:02 6ixfalls

Ah found it, turns out this bug was being created from a race condition between AncestryChanged and the new replacement Head being swapped in on the same frame.

To fix, simply hop into the 'Tracker' module (under ZoneController) and change line 208 from self:update() to task.defer(self.update, self).

Thanks for your help finding this bug, I'll officially publish this fix alongside the next ZonePlus release.

If this covers everything, feel free to close the issue.

1ForeverHD avatar Feb 08 '22 16:02 1ForeverHD

Thanks for the help! The fix worked fine.

6ixfalls avatar Feb 09 '22 00:02 6ixfalls

@1ForeverHD Sorry for the bump; this issue still occurs when accuracy is set to High. Either keeping the accuracy on default fixes it, or not applying the HumanoidDescription at all.

For an exact reproduction, simply add the line Zone.accuracy = ZonePlus.enum.Accuracy.High to line 4 of the Zone script in the above-linked repro place.

6ixfalls avatar Jan 11 '23 06:01 6ixfalls