PlayerMovement

PLAYER MOVEMENT

ASSIGNABLES

  • Graphics: Reference to the player graphics.

  • whatIsGround: Defines all layers recognized as grounds ( walkable surfaces )

MOVEMENT

  • autorun: If enabled, the player will not be able to walk, just to run.

  • walkSpeed: Speed while walking.

  • runSpeed: Speed while running.

  • crouchSpeed: Speed while crouching.

  • horizontalLadderSpeed: Speed horizontally while in a ladder.

  • verticalLadderSpeed: Speed to climb a ladder.

  • runAcceleration: Capacity to gain speed and reach the maximum speed.

  • runDecceleration: Capacity to lose speed and go idle.

  • airAcceleration: Capacity to gain speed and reach the maximum speed mid-air.

  • airDeceleration: Capacity to lose speed mid-air.

  • maxFloorAngle: Maximum floor angle to consider as a walkable area.

  • playerOrientationMethod:

    • None: Player will always face the same direction.

    • Horizontal Input: Player will face the direction based on the Movement keys ( A - D by default )

    • Aim Based: Player will always look towards the direction of the cursor.

    • Mixed: Player will face towards the direction of the cursor and movement.

  • turnMethod:

    • Simple: Clamps orientation directly.

    • Smooth: Smoothly transitions from facing one direction to the other.

  • gravityScale: Gravity strength.

  • fallGravityMult: Gravity added. ( As a multiplier ).

  • maxFallSpeed: Limit the maximum fall speed.

  • maxUpwardsSpeed: Limit the maximum vertical speed ( going upwards )

JUMP

  • jumpMethod: Configures the way the jump works. Default: Press to jump. You are able to hold. Hold to Jump Higher: Press = Tiny jump. Hold = Higher jumps depending on the held time.

  • amountOfJumps: How many jumps you can do before landing. 1 is the default value assigned.

  • jumpForce: How tall you will jump.

  • apexReachSharpness: Adjust the stiffness of the jump. The higher this value is the sharper it will perform. Usually, sharp jumps are more responsive than smooth jumps, but it all depends on the style you are looking for.

  • jumpHangGravityMult: Jump Hang is the movement at the apex of the jump. This adjusts the gravity of the jump in that point.

  • jumpHangTimeThreshold: Enable jump hang depending on the current velocity, so it gets activated before reaching the apex.

  • jumpHangAccelerationMult: Acceleration multiplier on the apex of the jump.

  • jumpHangMaxSpeedMult: Speed multiplier on the apex of the jump.

  • fastFallMultiplier: When falling, you can press “S” to fall faster. Adjust the multiplier here.

CROUCH

  • allowCrouch: Allow the player to crouch.

  • canCrouchSlideMidAir: Allow the player to crouch while airborne.

  • crouchSlideSpeed: if the player has enough speed momentum when crouching, it will perform a slide. Adjust the force of that slide.

  • crouchSlideDuration: Adjust the duration of the crouch slide.

  • crouchCollisionOffset: Vertical offset of Crouch collision to ensure it´s properly alligned on the ground when crouching.

ADVANCED MOVEMENT

WALL JUMP

  • wallJumpForce: impulse of the wall jump.

  • wallJumpRunLerp: Speed to adjust the velocity from walking to running when you wall jump.

  • wallJumpTime: Duration of the wall jump before going back to default state.

WALL SLIDE

  • wallSlidingResetsJumps: Enable to reset the amount of jumps when wall sliding.

  • wallSlideSpeed: Velocity of wall sliding.

  • wallSlideVFXInterval: Interval in seconds to display Wall slide visual effects-

  • wallSlideVFX: GameObject that represents the visual effects for sliding.

DASH

  • dashMethod: Configure the behaviour of the dash. None: Disables dashing. Default: Based on Horizontal movement. AimBased: Dash wherever you are aiming. HorizontalAimBased: Dash Horizontally based on the aim.

  • amountOfDashes: How many dashes you have available.

  • dashCooldown: Time in seconds to being able to use dashes again.

  • dashGravityScale: Gravity when dashing.

  • dashDuration: Duration in seconds of the dash.

  • dashSpeed: Travel velocity when dashing.

  • dashInterval: When you stopped dashing, time to being able to perform a new dash ( to avoid dash clipping )

  • invincibleWhileDashing: If enabled, the player won´t be able to receive damage while dashing.

GLIDE

  • glideSpeed: Speed of movement when gliding.

  • glideGravity: How fast the player goes downwards when gliding. canDashWhileGliding: Allows dash if gliding. glideDurationMethod: Adjusts the duration method for the gliding. None: Infinite gliding. TimeBased: Adjusts the duration based on a timer in seconds.

  • maximumGlideTime: Duration of the glide in seconds. handleOrientationWhileGliding: Allow the player to orientate ( based on the current orientation method ) while gliding.

STAMINA

  • usesStamina: "You will lose stamina on performing actions when true.

  • minStaminaRequiredToRun: Minimum stamina required to being able to run again.

  • maxStamina: Max amount of stamina.

  • staminaRegenMultiplier: Speed to regenerate the stamina.

  • staminaLossOnJump: Amount of stamina lost on jumping.

  • staminaLossOnWallJump: Amount of stamina lost on jumping.

  • staminaLossOnCrouchSlide: Amount of stamina lost on sliding.

ASSIST

  • coyoteTime: Coyote Jump allows the player to jump responsively, even when leaving a ground or surface, there is still a timing that allows the player to jump. Adjust this number to configure the way that works.

  • jumpInputBufferTime: Allows for a more responsive jump.

OTHERS

  • Step: Stores the SurfaceEffects for each surface.

  • footstepsInterval: Speed at which the footsteps are played.

  • footstepsVolume: Volume at which the footsteps are played.

  • stepHeight: Maximum height allowed for a surface to be allowed as a step.

  • landVolume: Volume at which the land SFX is played.

  • landOnEnemyDamage: Damage applied on an enemy when landing on it.

  • landOnEnemyImpulse: Upwards impulse applied to the player when landing on an enemy.

ADDING NEW PLAYER CONTROLLERS

Please refer to Adding a Player Controller.

Last updated