decentraland / sdk

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

Tweens affect Transform relative to parcel coordinates #1062

Closed nearnshaw closed 8 months ago

nearnshaw commented 8 months ago

After making a tween, the transform position seems to be affected in a weird way. Even thought we see the position where we expect, if we query the Transform component, we get very weird numbers.

This example scene was broken by changing utils.path to using the Tween component. You can now only push each box once. See in the video that we're logging the position of the item before moving and after moving. Even though the item moves just a couple of meters, the end position is something completely absurd.

https://github.com/decentraland/sdk/assets/3507907/16d69024-7548-42f9-a9ba-1681b64597a8

We go for example from (8 , 0.16 , 7) to (-36 , 0.1599999964237213 , 85) What's weird is that the item does still look like it's in the right place

Find the scene here: https://github.com/decentraland/sdk7-goerli-plaza/tree/main/push-box-puzzle

The scene was in coordinates 84,-5 I tried changing the coordinates of the scene to 0,0 and suddenly everything was fixed!!! The only thing I changed since the last video was the coordinates in scene.json.

https://github.com/decentraland/sdk/assets/3507907/8f8507cf-8db1-4de6-87f0-a32fda182016

That would also explain why I haven't been able to reproduce this issue in the Playground, because there we're always in 0,0 Here is a scene that works perfectly well: link

I have a strong feeling that this also explains the problems we have with tweens + trigger areas

pravusjif commented 8 months ago

tackled at https://github.com/decentraland/unity-renderer/pull/6037, will reach production with next explorer's release and subsequent SDK release

pravusjif commented 7 months ago

Fix released with @dcl/sdk@7.3.36