Skip to content

Instantly share code, notes, and snippets.

@seanellul
Last active November 10, 2022 20:44
Show Gist options
  • Select an option

  • Save seanellul/5645400e1064a9a064bfab86a7206ebf to your computer and use it in GitHub Desktop.

Select an option

Save seanellul/5645400e1064a9a064bfab86a7206ebf to your computer and use it in GitHub Desktop.
//cameraTarget is what's interesting here. Being able to have more ways to impact this variable could give us a lot more leeway to build immersive experiences in dcl.
import { movePlayerTo } from '@decentraland/RestrictedActions'
const respawner = new Entity()
respawner.addComponent(new BoxShape())
respawner.addComponent(new Transform({ position: new Vector3(8, 0, 8) }))
respawner.addComponent(
new OnPointerDown(
(e) => {
movePlayerTo({ x: 1, y: 0, z: 1 }, { x: 8, y: 1, z: 8 })
},
{ hoverText: "Move player" }
)
)
engine.addEntity(respawner)
//Scene.Json:
"requiredPermissions": [
"ALLOW_TO_MOVE_PLAYER_INSIDE_SCENE"
],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment