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.

1 Like

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)