Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/decentraland-scenes/Basic-Interactions

A minimal scene that shows all the basic ways a player can interact with a scene.
https://github.com/decentraland-scenes/Basic-Interactions

decentraland

Last synced: about 1 month ago
JSON representation

A minimal scene that shows all the basic ways a player can interact with a scene.

Awesome Lists containing this project

README

        

# Basic button events

A scene with examples of some simple interactions. Perform the corresponding action on each cube to turn it green.

![](screenshot/screenshot.png)

This scene shows you:

- How to handle a click event on an entity
- How to handle pointer down event on an entity
- How to handle pointer up event on an entity
- How to handle a global pointer down event
- How to handle a global pointer up event
- How to handle key E up and down events on an entity
- How to handle key F up and down events on an entity
- How to handle global key E up and down events
- How to handle global key F up and down events
- How to periodically check the distance between the player and an entity
- How to fetch the name of the specific mesh that a button event acted on from a GLTFShape, to handle different behaviors depending on the mesh
- How to change the materials of a primitive shape
- How to delay an action

## Try it out

**Install the CLI**

Download and install the Decentraland CLI by running the following command:

```bash
npm i -g decentraland
```

**Previewing the scene**

Download this example and navigate to its directory, then run:

```
$: dcl start
```

Any dependencies are installed and then the CLI opens the scene in a new browser tab.

**Scene Usage**

Follow the labels on each cube to turn it green, testing all the different ways a player can interact with a Decentraland scene.

Learn more about how to build your own scenes in our [documentation](https://docs.decentraland.org/) site.

If something doesn’t work, please [file an issue](https://github.com/decentraland-scenes/Awesome-Repository/issues/new).

## Copyright info

This scene is protected with a standard Apache 2 licence. See the terms and conditions in the [LICENSE](/LICENSE) file.