User Tools

Site Tools


climbing

This is an old revision of the document!


Climbing


The climbing mechanic and related functionality allows characters to traverse tiles vertically. This provides a simple way to create things like ladders or ropes for your game!

Setting Up Climbable Tiles

To demonstrate, let's assume that you'd like to create a ladder to reach the roof of a building. The first thing you'll need to do is create a tile for your ladder (or ladder segment if using multiple linked together). These must be tiles, and not objects, as they will be placed into the map vertically and linked with other tiles, acting as a surface for characters to traverse.

Once placed, select each ladder tile while in “Edit” mode and enable the “Climbable” setting from the Entity Properties panel. Until a climbable tile has been linked to other tiles, its marker icon will show as a “ladder” with greyed out arrows as shown below.

Next, if you have multiple ladder segments, you'll need to connect all of them together into a series. To do so, select an adjacent pair of ladder tiles, then right-click on one of them and select “Climb” from the “Navigation/Interaction” submenu. The marker icons will update to indicate if a particular climbable tile is connected to another tile above or below it by displaying the corresponding arrow as green instead of grey.

In order for a character to be able to mount/dismount the ladder, you'll also need to connect the top and bottom of it to adjacent tiles. These will determine where the character can grab onto the ladder from as well as where they will step when dismounting the ladder. To do so, select both the top tile of the ladder and an adjacent tile, then, similar to the previous step, right-click on one of them and select “Climb” from the “Navigation/Interaction” submenu. Do the same for the bottom ladder tile and an adjacent tile.

Note that the tiles adjacent to the top and bottom of the ladder now have special marker icons to indicate that they are mount/dismount locations for characters.

This will get the basic climbing functionality working, but to create the proper appearance of the character climbing the ladder, you'll also need to define an animation, set up some attach points, and slow down the character as they move up the ladder.

Character Animation, Speed, and Positioning

- Animation named “climb” will play when climbing (first frame when initially grabbing on and the full animation when moving up/down)

You'll most likely want to slow down the character's movement speed to make the climbing look more natural. To do so, you can simply adjust the speed multiplier setting for the climbable tile from the Model Properties panel in the Voxel Editor. For the example ladder, I set the speed multiplier to 0.3.

- Define “climb” attach point on ladder and frames of “climb” animation for the character, otherwise character will be centered on ladder

- “Climb” attach point from first frame of character's “climb” animation is used for initial positioning, then just moved up/down from there

Game Controls

In-game, pressing the “C” key from a mount/dismount location will cause the player character to grab onto the adjacent climbable tile. While grabbed on, holding the “Up” and “Down” arrow keys will move the character up and down until the top or bottom is reached, at which point the character will dismount.

Since any connected climbable tiles are integrated into your game's navigation, the player character will automatically consider them as paths when using mouse controls to move around the map. A climbable tile can also be clicked on to move the player character directly to it, for example to climb up to a specific ladder segment.

climbing.1618431947.txt.gz · Last modified: 2021/04/14 13:25 by justin