decentraland / sdk

PM repository for SDK
Apache License 2.0
4 stars 4 forks source link

Entity switch up on hot reload #987

Closed nearnshaw closed 11 months ago

nearnshaw commented 1 year ago

When doing hot reload, sometimes some entities get messed up. It seems like some components aren't cleaned up, and are assigned to the wrong entity.

In the "rotating-platforms" scene, from Goerli Plaza, I see it happen 100% of the time. https://github.com/decentraland/sdk7-goerli-plaza/tree/main/rotating-platforms

1) Open the scene, it loads fine 2) Just add an enter and save one of its files 3) The scene reloads with weird things in places they shouldn't be, and things that should be static rotating.

In this video, we start with the scene working fine, then I do hot reload and it gets messed up.

https://github.com/decentraland/sdk/assets/3507907/e4fba6fa-c941-4d8f-8c57-b301a79e4932

The "moving-platforms" scene also has this problem, although its effects are less obvious.

This seems to only affect some scenes, possibly depends on how entity ids line up.

nearnshaw commented 1 year ago

This may or may not be related, but running around Goerli Plaza I also came across some random cases that look like the same bug Some entities rotated or shifted for a second after loading, then stopped, but remained in the wrong position

I could not find a way to reproduce these, they only happened once. The scenes loaded fine if I walked away and came back

Image Image

nearnshaw commented 1 year ago

Similarly to the previous comments, I also saw EMPTY PARCELS with displaced entities This is also quite random and hard to reproduce

Image

pravusjif commented 11 months ago

There was a bug in the Tween component, tackled at https://github.com/decentraland/unity-renderer/pull/5972

pravusjif commented 11 months ago

Fix merged, will reach production with next explorer + sdk release (probably next monday 27)