Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on March 30, 2023, between 5 am & 1 pm EST, in the Performance Profiling Dev Blitz Day 2023 - Q&A forum and Discord where you can connect with our teams behind the Memory and CPU Profilers.
    Dismiss Notice

FPS microgame character controller, stairs and platforms

Discussion in 'Getting Started' started by niknakgames, Jul 22, 2020.

  1. niknakgames

    niknakgames

    Joined:
    Aug 7, 2015
    Posts:
    25
    Hello,

    I was playing around with the FPS micro game and seems to work pretty well and the character controller seems much more simple and less bloated than everything on the asset store.
    I plopped the player into a scene with stairs and it seems to not climb them smoothly at all. It also plays the landing sounds every step and overall just feels horrible.
    I also tried a vertical moving platform and it spams the landing sounds and has very jerky movement.

    Any way to fix this issue?

    Thanks!
     
    mcdahl likes this.
  2. mcdahl

    mcdahl

    Joined:
    Dec 23, 2016
    Posts:
    2
    A little late but for anyone that comes across this issue...

    For the stairs issue in the HandleCharacterMovement() method in the PlayerCharacterController class there is some logic at the bottom of the method in a Capsule Physics Cast. Im sure there is a better way to do it but I added a check to see if the object we are hitting is tagged as a slope and if so run that code, otherwise skip it.

    Code (CSharp):
    1.  
    2. if (hit.collider.gameObject.tag == "slope")
    3.        {
    4.            CharacterVelocity = Vector3.ProjectOnPlane(CharacterVelocity, hit.normal);
    5.         }