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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

CharacterController Step Offset error

Discussion in 'Editor & General Support' started by Tzan, Jun 22, 2015.

  1. Tzan

    Tzan

    Joined:
    Apr 5, 2009
    Posts:
    733
    This worked fine in 4.3
    all scaling set to 1
    Radius .5
    Height 1
    Step Offset 10
    I used this on a camera that was floating in the air, but if it hit some terrain, would just pop up to stay over the terrain.

    I imported to 5.1.1 today and I get the following error message:

    Step Offset must be less or equal to <scaled Height> + <scaled Radius> * 2
    UnityEditor.DockArea:OnGUI()


    Why is Unity deciding for me what the limit of a Step Offset should be?

    Also the formula seems to be wrong.
    You can read it two ways depending on when you multiply, but either way its wrong in the editor.
    Radius 1 Height 1, the result is either 4 or 3 meters.
    In the inspector when I set Step Offset to any number over 2.0, an Error message appears in the Console.

    Is the formula bugged?
     
    LVBen likes this.
  2. yuvalhaz

    yuvalhaz

    Joined:
    Jun 10, 2012
    Posts:
    4
    i also have this problem
    did you solve it??
     
  3. Tzan

    Tzan

    Joined:
    Apr 5, 2009
    Posts:
    733
    Nope.
    Looks to me like they refuse to multiply by 2.
    But I really dont understand the need for a limitation.

    The only work around, short of writing your own character controller is to make the collider bigger, which is probably not ideal.
     
  4. MisterDr

    MisterDr

    Joined:
    Sep 8, 2015
    Posts:
    1
    I had same issue too, but this occurs to me only when Character controller is inside the Canvas or another object. When I moved it out at the root it vanishes.
     
  5. Tzan

    Tzan

    Joined:
    Apr 5, 2009
    Posts:
    733
    I have it set up in a root object.
     
  6. Samuel-Karlos

    Samuel-Karlos

    Joined:
    Sep 26, 2015
    Posts:
    3
    Step Offset put to 0.
     
    Maynk likes this.
  7. Tzan

    Tzan

    Joined:
    Apr 5, 2009
    Posts:
    733
    That does nothing.
    With Radius and Height set at 1, Step Offset at 0 = you can get over 1 meter only

    If that's working for you, getting you over 10 meters, then it must be a custom script.

    Changing Step Offset to 3+ still gives the same error message.
     
    thisisajaikumar likes this.
  8. Dynam1ke

    Dynam1ke

    Joined:
    Jun 9, 2014
    Posts:
    4
    There might be good reason for the limitation. imagine there was a roof over your object you want to step over, the collider wouldnt be able to detect it. so if you are sure there are usually no objects above your controller you may increase the height of it anyway, no?
     
    thisisajaikumar likes this.
  9. Maynk

    Maynk

    Joined:
    Aug 17, 2020
    Posts:
    3
    thanks its Work
     
    thisisajaikumar likes this.
  10. Deleted User

    Deleted User

    Guest

    IK this is late but thanks... my code is now working after putting the step offset to 0
     
  11. nataliasita04

    nataliasita04

    Joined:
    Oct 14, 2022
    Posts:
    1
    I got the same error and I solved it by modifying the scale of the model from the import and not from the transform