An example Decentraland scene demonstrating how to manage multiple animation states on a single object using SDK 7.
This project showcases a finite state machine (FSM) approach to handle distinct animations for a 3D model within a Decentraland scene. The object cycles through different animations based on player interaction: a default idle state, a proximity-based state, and an uninterruptible state triggered by a click.
- Idle State: A default, looping animation (
Idle_Anim). - Proximity State: A looping animation that plays when the player is near the object (
Proximity_Anim). - Click State: A non-looping, uninterruptible animation triggered by player interaction (
Click_Anim). - Finite State Machine: A clean and robust pattern to manage animation states and prevent conflicts.
-
Download this repository.
-
Install the Decentraland Editor.
-
Open a Visual Studio Code window on this scene's root folder.
-
Open the Decentraland Editor tab and press Run Scene.
Alternatively, you can use the command line. Inside this scene's root directory, run the following commands:
- Install the dependencies:
npm install- Run the scene:
dcl startThis project is licensed under the MIT License - see the LICENSE.md file for details.