======Climbing====== ---- The **climbing** mechanic and related functionality allows [[character|characters]] to traverse [[tile|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 [[tile|tiles]], and not [[object|objects]], as they will be placed into the [[map]] vertically and linked with other [[tile|tiles]], acting as a surface for [[character|characters]] to traverse. {{:ladder_placement.gif?nolink|}} 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 [[tile|tiles]], its marker icon will show as a "ladder" with greyed out arrows as shown below. {{:climbable_tile_setting.png?nolink|}} 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 [[tile|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. {{:ladder_connecting_01.gif?nolink|}} 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 [[tile|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 roof [[tile]]. Then right-click on one of them and select "Climb" from the "Navigation/Interaction" submenu, similar to the previous step. Do the same for the bottom ladder [[tile]] and an adjacent ground [[tile]]. {{:ladder_connecting_02.gif?nolink|}} Note that the [[tile|tiles]] adjacent to the top and bottom of the ladder now have special marker icons to indicate that they are mount/dismount locations for [[character|characters]]. =====One-Way and Forced/Automatic Climbing===== When connecting navigation between the [[tile|tiles]], you can also use the "Climb (One-Way)" option to restrict [[character|characters]] to only climbing in one direction. The direction is based on the order in which you select the two [[tile|tiles]] (i.e. the connection will be made from the first [[tile]] to the second [[tile]], but not vice versa). Another option for climbable [[tile|tiles]] is "Forced/Automatic Climbing". This setting is found under the "Climbable" toggle button and will force [[character|characters]] to continue climbing in their current direction when reaching that particular [[tile]]. This is useful for certain scenarios, for example a pole that [[character|characters]] are forced to slide down, or if you just want [[character|characters]] to always climb up or down the full extent of a ladder when grabbing onto one. {{:climbable_tile_settings_section.png?nolink|}} {{:climbing_forced_one_way.gif?nolink|}} 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 and down the ladder. =====Character Animation and Speed===== When climbing a ladder or other climbable [[tile]], the "climb" [[animation]] will be triggered (if defined for the [[character]]). The first frame of the [[animation]] will display when initially grabbing on, and the full [[animation]] will be played while moving up and down. {{:climb_anim_example.gif?nolink|}} If you want specific climbable [[tile|tiles]] to trigger an [[animation]] other than "climb", you can use the "Climb Animation" setting found under the "Climbable" toggle button. If an override is defined here, any [[character|characters]] climbing that particular [[tile]] will use the specified [[animation]] name instead of "climb". {{:climbable_tile_settings_section.png?nolink|}} You'll most likely want to slow down the [[character|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. {{:tile_speed_multiplier.png?nolink|}} =====Character Positioning===== In order for [[character|characters]] to be properly aligned with the ladder while climbing it, you'll need to define an [[attach_points|attach point]] named "climb" for both the [[character]] and the climbable [[tile]]. If these are not defined, the [[character]] will just be centered on the [[tile]]. For the [[character]], the "climb" [[attach_points|attach point]] should be added to the first frame of its "climb" [[animation]]. This [[attach_points|attach point]] will be used for initial positioning on the climbable [[tile]], and then from there the [[character]] will just be moved up and down. In the example below, the [[attach points]] have been added to the [[character|character's]] left hand and to the left side of the ladder's top rung. Since the ladder is positioned at the back (north) side of the [[tile]] boundaries, its "climb" [[attach_points|attach point]] has been rotated 180 degrees around the z-axis so that [[character|characters]] will properly face the ladder while climbing it. {{:climb_attach_points.png?nolink|}} =====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 [[tile|tiles]] are integrated into your game's [[navigation_and_interaction|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. =====Known Issues===== When using only a single [[tile]] for a ladder or other climbable structure, the [[character|character's]] climbing [[animation]] will never play. This is due to the fact that the [[character]] "snaps" to the ladder when grabbing onto it and then "snaps" again when dismounting onto the adjacent [[tile]] at the other end. ~~NOTOC~~