easy-games / chickynoid

A server-authoritative networking character controller for Roblox.
https://easy-games.github.io/chickynoid/
MIT License
221 stars 31 forks source link

Instances that are removed then re-added as collision folder descendants do not have collision #16

Open metacrab opened 2 years ago

metacrab commented 2 years ago

In CollisionModule, descendants of the collision folder are factored into the collision hash map and recorded in module.hullRecords.

When an instance is removed, it is automatically removed from the hash map (line 900), but the module.hullRecords reference still exists.

If the same instance once again becomes a descendant of the collision folder (e.g parented to nil, then re-parented), ProcessCollisionOnInstance returns because the module.hullRecords record already exists and the instance is not added to the collision hash map.

I'd file a PR but I'm not sure what the intention is. You could remove the module.hullRecords reference in DescendantRemoving on line 903 if you're only using it as a debounce type thing.

metacrab commented 2 years ago

image

fyi i'm just doing this as a temp fix for now 🤷

MrChickenRocket commented 2 years ago

Dynamic adding, removing and updating parts in the collision system is not well battle tested, so this is probably a bug :)

metacrab commented 2 years ago

Noted! I'm doing it in a prototype at the moment and there have been a few little things I needed to fix but overall not too bad.