SmartlyDressedGames / Unturned-3.x-Community

Community portion of the Unturned-3.x repo. If you have access to the source code you can find it here:
https://github.com/SmartlyDressedGames/Unturned-3.x/
83 stars 17 forks source link

InteractableDoor.updateState does not Reset Disabled Colliders #4446

Closed Gamingtoday093 closed 1 week ago

Gamingtoday093 commented 2 weeks ago

When an InteractableDoor is destroyed into the pool while playing it's opening or closing animations the doors Animated Colliders will remain Disabled as disableAnimatedColliders finishes early making it permanently uninteractable. This is because the Colliders are not reset in updateState when the InteractableDoor is instantiated from the pool again.

Perhaps it could be helpful to also check other areas where you're using Coroutines that might get cancelled early, just to ensure they're being handled correctly.

SDGNelson commented 2 weeks ago

Thank you for the report - good catch! I'll ensure this is fixed for the next update.

SDGNelson commented 1 week ago

This will be fixed on the preview branch soon. 😉 I put the fix in OnDisable so it should happen when returning to the pool. I tested by standing inside the door while the colliders were off, destroying the door, and then placing down another one.