Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Definition: Teleport is now handled viaTransform.getMutable(PlayerEntity).position #356

Closed
Tracked by #369
menduz opened this issue Jul 4, 2022 · 1 comment
Closed
Tracked by #369
Assignees
Labels
sdk7-blocker Blocks the GA release of SDK7

Comments

@menduz
Copy link
Member

menduz commented Jul 4, 2022

As of today's SDK 6, the method to teleport the current user is imported as a module and a function teleportTo(sceneCoords) and movePlayerTo(vec3).

The action teleportTo moves your player to a different parcel, it is useful for hubs and other discoverability mechanisms. We may want to keep that as-is because it involves that the current scene will most likely be terminated along with all the rest of the nearby scenes. No data-oriented approach has been explored.

The case of movePlayerTo(vec3) is slightly different, since it moves the player within the boundaries of the scene. That, by all practical means, is the same as changing the Transform component of the Player entity.

The recommended approach for this implementation, is to remove the movePlayerTo in its discrete function shape, and re-use the same Transport.getFrom(PlayerEntity) that is used to read the player position, in this case to write the new position. It should emit a PUT CRDT message, that is forwarded to the renderer which should either accept or deny the new message based on the current scene rules and permissions to move the player. In the case of the renderer rejecting this new position, it should create an overwriting message with an ID+1 to normalize the Transform in the scene code itself.

@menduz menduz added the sdk7-blocker Blocks the GA release of SDK7 label Jul 4, 2022
@menduz menduz added this to the ECS 7.0.0 - Feature parity milestone Jul 4, 2022
@menduz menduz changed the title Teleport capabilities Teleport capabilities edit Transform.of(PlayerEntity) Jul 6, 2022
@pbosio
Copy link

pbosio commented Aug 4, 2022

decentraland/unity-renderer#2787
modifying PLAYER_ENTITY Transform teleports the player

@pbosio pbosio closed this as completed Aug 4, 2022
@menduz menduz changed the title Teleport capabilities edit Transform.of(PlayerEntity) Definition: Teleport is now handled viaTransform.getMutable(PlayerEntity).position Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sdk7-blocker Blocks the GA release of SDK7
Projects
Status: Done
Development

No branches or pull requests

2 participants