Skip to main content

ClimbingSettings

A class in Root.Township, the global namespace.

Global settings for climbing: what can be grabbed, how hands pull the body, hand stamina drain and regen, and grab effects. Get it with ClimbingSettings.Instance.

Constructors​

MemberWhat it is
ClimbingSettings()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

33 private and internal fields
MemberWhat it is
private int activeTightGripLayerLayer index used for the active tight grip (default 31).
private AnimationCurve againstDragCurve of drag that resists velocity against the wanted direction.
private float assumedBasePlayerWeightBase player weight. Grip and pressure limits are multiplied by it, so a higher value needs more force to move.
private float bodyHeightCharacter controller height while climbing.
private float bodyHeightTransitionDurationSeconds to go from normal height to climbing height.
private AnimationCurve distanceFromWallDirectionPowerCurve giving the power the push or pull alignment is raised to, based on arm stretch.
private float extraResistPressurePerHandExtra pressure per hand for resisting pull in the opposite direction, times the base weight.
private AnimationCurve frictionFadeFriction over time after letting go. Starts at the curve's 0 while climbing.
private PositionHandler grabBrokenEffect hook played when a hold breaks.
private AnimationCurve grabHapticHaptic curve on a successful grab.
private float grabRadiusRadius around the hand checked for climbable colliders (default 0.1).
private PositionHandler grabSuccessfulEffect hook played on a successful grab.
private AnimationCurve handDistanceDrainStamina drain multiplier from how far the ghost hand is from the climbing hand.
private float hangDistanceDistance before an overburdened player stops being pulled down by gravity.
private AnimationCurve holdBreakHapticHaptic curve from how close the hold is to breaking.
private AnimationCurve incorrectHandStrengthModifierCurve of strength gain or loss over time from ghost hand distance.
private LayerMask layerMaskLayers checked for grabbing.
private ClimbingSettings.LayerStaminaConsumptionMultiplier[] layerStaminaConsumptionMultipliersPer-layer stamina use multipliers. Layers not listed use 1.
private StatDefinition leftHandStaminaStat used for left hand stamina.
private float maximumGripPerHandMost grip per hand, at full arm stretch, times the base weight.
private float maximumPressurePerHandMost pressure per hand including gravity resistance, times the base weight.
private float minimumTimeBeforeConsideringShakingSeconds since last climbing before a hand counts as shaking for regen.
private AnimationCurve pressureFromDistanceCurve of velocity added from the ghost hand's distance to the grip point.
private float pressureSmoothingHow much pressure is kept to smooth movement. Higher is smoother.
private StatDefinition rightHandStaminaStat used for right hand stamina.
private float staminaHangMultiplierMultiplier on stamina lost while hanging.
private float staminaLossPerSecondStamina lost per second, based on the base weight.
private float staminaRegenPerSecondIdleStamina regained per second when idle and not holding.
private float staminaRegenShakeMultiplierRegen multiplier when shaking the hand.
private float startingValueForMaximumStaminaStarting maximum stamina used to scale shake regen in GetStaminaRegen.
private float stepHeightHeight the character controller can step up while climbing.
private float towardsPalmOffsetWhen placing a grip, how far the nearest mesh point is pulled back toward the hand.
private float velocityDampeningScale on the player's movement velocity used to offset the climbing hand's position in ClimbingHand.

Properties​

MemberWhat it is
int ActiveTightGripLayer { get; }Layer index used for an active tight grip. Default 31.
AnimationCurve AgainstDrag { get; }Curve for drag that resists moving against the wanted direction.
float AssumedBasePlayerWeight { get; }Player weight the grip and pressure values are scaled by. Higher means more force needed. Default 80.
float BodyHeight { get; }Controller height while climbing. Default 1.
float BodyHeightTransitionDuration { get; }Seconds to change to climbing height. Default 0.2.
IClimbable DefaultClimbable { get; }Climbable settings used for surfaces without their own.
AnimationCurve DistanceFromWallDirectionPower { get; }Curve setting how much push and pull alignment counts, by arm stretch.
float ExtraResistPressurePerHand { get; }Extra pressure for resisting the opposite direction, times the base weight.
AnimationCurve FrictionFade { get; }Friction curve over time after letting go.
PositionHandler GrabBroken { get; }Effect hook when a hold breaks.
AnimationCurve GrabHaptic { get; }Haptic curve on a successful grab.
float GrabRadius { get; }Radius around the hand searched for grabbable colliders. Default 0.1.
PositionHandler GrabSuccessful { get; }Effect hook on a successful grab.
AnimationCurve HandDistanceDrain { get; }Curve for extra stamina drain by how far the ghost hand is from the gripping hand.
float HangDistance { get; }Distance before an overburdened player stops being pulled down. Default 0.8.
AnimationCurve HoldBreakHaptic { get; }Haptic curve by how close the hold is to breaking.
AnimationCurve IncorrectHandStrengthModifier { get; }Curve for strength gained or lost over time by ghost hand distance.
LayerMask LayerMask { get; }Layers checked for climbable surfaces.
StatDefinition LeftHandStamina { get; }Stat used for the left hand's stamina.
float MaximumGripPerHand { get; }Most grip one hand can apply (at full stretch), times the base weight.
float MaximumPressurePerHand { get; }Most pressure one hand can apply, including against gravity, times the base weight.
AnimationCurve PressureFromDistance { get; }Curve for velocity added by how far the ghost hand is from the grip point.
float PressureSmoothing { get; }Pressure kept to smooth movement. Higher is smoother.
StatDefinition RightHandStamina { get; }Stat used for the right hand's stamina.
float StaminaHangMultiplier { get; }Multiplier on stamina loss while hanging. Default 0.5.
float StaminaLossPerSecond { get; }Stamina lost per second, based on the base weight. Default 0.1.
float StepHeight { get; }Height the controller can step up while climbing. Default 1.
float TowardsPalmOffset { get; }When gripping, how far back towards the hand from the nearest surface point. Default 0.2.
float VelocityDampening { get; }Velocity dampening while climbing. Default 1.

Methods​

MemberWhat it is
float GetLayerStaminaConsumptionMultiplier(int layer)Stamina drain multiplier for a surface layer. 1 if the layer is not listed.
float GetStaminaRegen(float currentMaximumStamina, float shakeValue, float lastClimbingTime)Stamina regained per second while not holding, more when shaking the hand after a short wait.

Used in​

Members of other types that take, return or hold a ClimbingSettings: