Fallen Parts Destroy Height Does Not Trigger Destroying Event

Reproduction Steps

Create a Destroying event for a part.

Let it drop off the baseplate.

fallen parts bug repro.rbxl (27.1 KB)
Expected Behavior

I expect the Destroying event to fire.

Actual Behavior

The event does not get triggered. I assume the Destroy() call should have been called internally?

image

Issue Area: Engine
Issue Type: Other
Impact: High
Frequency: Constantly
Date First Experienced: 2022-06-15 00:06:00 (-07:00)
Date Last Experienced: 2022-06-15 00:06:00 (-07:00)

2 Likes

This really shouldnā€™t be changed, documentation should be updated. I donā€™t want every single line of code I reparent part of a model to potentially error because it has been destroyed. This would be a major breaking change.

1 Like

Like @Qualadore said, this is indeed a documentation issue - we donā€™t want fallen parts to call Destroy(). We have already filed a request internally, but it looks like we havenā€™t gotten around to fixing this yet. Iā€™ll follow up again with our Documentation team and see if we can get this fixed soon!

5 Likes

So what am I suppose to use if an Instance is destroyed regardless of whether by :Destroy() or not? AncestryChanged?

AncestryChanged would work. You could also use GetPropertyChangedSignal("Parent").

I think what actually happens is that Instance.Parent gets set to nil, so you want your script to listen for that instead of the Destroying event.

Sorry for the inconvenience :frowning:

2 Likes

Iā€™m unclear on why itā€™s called FallenPartsDestroyHeight then.

3 Likes

This still needs to be fixed, the issue is fallen parts are just re-parented or something, but donā€™t get the ā€˜Destroyā€™ method called on them.

This has nothing to do with the ā€˜Destroyingā€™ event being called for instances just being reparented which is what was mentioned above. The behaviour of fallen parts is what needs to be changed.

Please change, current behaviour is unexpected and causing bugs, and is hacky to replace with just checking for Parent = nil.

(Bonus bug: if you keep a reference to the fallen instance and destroy it again after, it fires Destroying twice simultaneously)

Just to close out this thread, the description for FallenPartsDestroyHeight was corrected earlier this year. It no longer states that parts are ā€˜destroyedā€™. Thanks for reporting this!