In my tower defense game, a bug has been occurring after some time is spent in game (10+ minutes) where raycasts stop detecting new parts. These parts are utilized as a way to select and hover over your towers, so you can see why it has become such a large issue. After a large amount of testing and bug fixing, I’m almost certain it’s an engine bug. After this threshold is hit and the raycasts stop detecting new parts, I’ve tested and mouse.Target even ignores these objects.
Playing around and testing whether high ping / memory usage contributes to this issue, I’ve created this clip to display that the instance is clearly there (Using an in game explorer to make sure the parts are replicated properly), and it boils down to the fact that the mouse raycasting does not hit that new bounding box object.
https://i.gyazo.com/5fef895d3e657ce7672f1a731974ac9e.mp4
Towards the end of the clip you can see that the other tower I highlight works properly, and that this only applies to newly created objects at this point in time.
As far as workarounds go I’ve tried a few different things that all end up not working. This includes creating a local bounding box after the client reads child added to make sure there isn’t any replication issues, even going as far as creating many of these bounding boxes on startup, then altering their size and cframe instead of creating a bounding box, and much more.
https://gyazo.com/433f296c229a2c90b624eac001f0784d
This code snippet above proves that there is no error mediator that is causing this issue, at it’s core, mouse.Hit should not be returning nil nor should my raycast logic when clearly hovering over an existing object, parented to the model within the filter descendants.