Movement and Interaction Tutorial
The lanterns in the Scene Graph tutorial use multiple Verse-authored components to create dynamic and interactive prefabs. This is possible by programming movement and interactability into a Verse-authored component.
Simulating Simple Movement
The light post prefab uses two different components to simulate moving the lantern. Both of these are attached to the Pivot entity, which provides a pivot point to move the lantern around. First, the keyframed_movement_component allows you to build animations from keyframes and then play them to animate an entity. This component can’t act alone however, and needs another piece of code to provide the keyframes and start the animation. This is where the custom simple_movement_component comes in. This script is reused across the project to control how different game objects move in the scene.
To learn more about using animations to move objects, check out Animating Prop Movement.
Let’s take a closer look at the simple_movement_component. Open up the SimpleMovementComponent.verse script from the Verse Explorer in Visual Studio Code to get started.
You're reading a preview
The full reference is free for BrainDeadGuild Discord members — sign in to read it all, or open the original at the source.
Sign in with your BrainDead.TV / BrainDeadGuild Discord account for full access.