The Hang ability allows the character to hang from flat objects. The hang ability is NOT able to climb up any object and is only designed for hanging. While hanging the character can:
- Start hanging from the ground or mid jump/fall.
- Start hanging by dropping down onto the hang object.
- Shimmy across curved objects.
- Transfer to another hang object in the vertical or horizontal direction.
- Pull up from a hang and stop the ability.
Hanging involves just the use of the character’s arms and it is not meant for the character to be able to free climb with their feet as well.
- Select the + button in the ability list under the “Abilities” foldout of the Ultimate Character Locomotion component.
- Add the Hang ability. This ability should be positioned near the top of the list so it will override any abilities beneath it. The Hang ability should be above the Fall ability and below the Jump ability.
- Ensure the hang animations have been added to the character. All Agility Pack abilities can be setup through the Add-Ons Manager or by selecting the “Build Animator” button under the Editor foldout of the Hang ability.
- Determine how the Hang ability should detect any hang objects. The Agility Pack demo scene adds an Object Identifier to each hang object and then the Hang ability detects which object it can hang on using a custom cast based off of the Object Identifier ID:
- Setup each hang object to be detected by the Hang ability. For the demo scene the Object Identifier component was added with an ID of 104.
- Modify the Hang’s Minimum Start Offset and Maximum Start Offset. This offset specifies the range that the Hang ability should detect other hang objects. In the screenshot below the vertical offset is shown with the black debug line. The bottom of the line is represented by the y value of the Minimum Start Offset, and the top of the line is represented by the y value of the Maximum Start Offset. Debug lines can be drawn if Draw Debug Lines is enabled. The black line in the image below represents the cast area which determines if Hang can start.
- Modify the Relative Hang Offset. This value represents the distance that the character should be placed away from the hang object while in a shimmy position.
- The remaining fields should work well at their default values. See the Inspected Fields below for a description of each field.
Draw Debug Lines
Should debug lines be drawn to the editor indicating the location of the horizontal and vertical casts?
Specifies which hang movements the character can perform.
- DropDown: The character can drop down from above the hang object.
- TransferUp: The character can transfer vertically from one hang object to another.
- TransferHorizontal: The character can transfer horizontally from one hang object to another.
- PullUp: The character can pull themselves up to end the ability.
- DropToStop: The character can drop to stop the ability.
- StartFromHorizontalClimb: The character can start hanging from a horizontal climb position. This movement requires the Climbing Pack.
- StartFromVerticalClimb: The character can start hanging from a vertical climb position. This movement requires the Climbing Pack.
Minimum Start Offset
The minimum offset from the character’s pivot that the ability can perform a movement.
Maximum Start Offset
The maximum offset from the character’s pivot that the ability can perform a movement.
Relative Hang Offset
The offset from the top of the character to the hang object.
Start Move Towards Speed
The speed that the character moves towards the starting position.
In Position Shimmy Distance
The character can shimmy when the vertical distance between the character and hang object is less than the specified amount.
In Position State Name
The name of the state when the character is in hang position.
Move Up Button Name
The name of the button that will transfer or pull the character up to the next hang state.
Change State Sensitivity
Specifies how sensitive the ability is when determining the next state. A value is 0 is the most sensitive while a value of 1 is the least.
Offset to detect hang objects when shimmying.
Hand IK Offset
Offset to apply to the hand position relative to the object hit at the hands position.
Pull Up Cast Distance
The distance that should be checked to determine if the character can pull up without any obstructing objects.
Stop Hang On Jump
Should the ability stop if the jump button is pressed?
Start Climb Offset
The offset used to check for a valid hang object if a climbing ability is active. This field will appear when the Climbing Pack is installed.
Start Vertical Climb Offset
The offset used to check for a valid hang object if the character is moving vertically with the free climb ability. This field will appear when the Climbing Pack is installed.