Spawning Platform Grids with Scene Graph
Generating a unique grid sequence of platforms where only a couple platforms in each row are valid to jump on is common for platforming game modes. This requires players to slow down and figure out the sequence.
This tutorial shows how to generate a grid of platforms where platforms on each row are randomly selected to have collision and light color to distinguish them while the rest don't.
Creating the Platform Prefab
Follow these steps to create a platform prefab that you'll spawn from Verse:
-
Place a new entity and promote it to a prefab named choose_one_platform_prefab. For instructions, see Prefab and Prefab Instances.
-
In the Prefab Editor, add the following components to the entity:
- transform_component: The transform component to position the platform.
- mesh_component: The mesh component to set the static mesh of the platform. This example uses the SM_block_02 mesh from the Stylized Egyptian World Pack asset in the Fab Marketplace.
- collision_component: The collision component for enabling and disabling collision on the platform.
- parent_constraint_component: The parent constraint component for easily setting the transform relative to the parent entity when spawning this prefab in the world using Verse.
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.