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.
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.
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
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