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

Unity 2017.2 new terrible bug

Discussion in 'Editor & General Support' started by SeriouSerg, Nov 8, 2017.

  1. SeriouSerg

    SeriouSerg

    Joined:
    Jan 27, 2013
    Posts:
    49
    I will soon open the rubric "The Coolest bug performed by Unity Engine"

    Just two things - classical character controller with moving kinematic wall:

    Another view:

    Interestingly, if you run to the wall in the opposite direction, everything is fine (the end of the video).

    Guys, it's just ridiculous. It is very similar to a crocked car that you repair constantly and it continues to break.
     
  2. giantkilleroverunity3d

    giantkilleroverunity3d

    Joined:
    Feb 28, 2014
    Posts:
    383
    I first found mysteries in doing physics. Now it is in product updates.
    It not your project failing. Back away from the keyboard.
    Right now there is a huge population not working.
    There are more current failures than posts about things working.
     
  3. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,294
    You do realize, that CC is not supposed to respond to physics collision forces on it's own?

    CC is merely a collision resolver. Imagine that it's a transform with a collider, that you can move, and it won't go though other colliders. Thing is - you're not moving. And I bet you do not apply any "force" to CC like rigidbody does in script itself. That's why you see the above behaviour.

    Read the manual one more time. Then again.

    Then - use OnControllerColliderHit to apply "forces" to move CC away from the wall. There's a new thing called Physics.ComputePenetration for that.

    CC does what it does. It calculates static collisions and allows us, programmers do the things we want to do with it.
    CC is the way of implementing custom physics behaviour on top of the existing physics engine.

    If you don't know how to implement physics - dump CC. Just download some custom asset written controller from Asset Store, or use rigidbody controller (though, I doubt it will help, if this is the case).

    There's other bugs with CC. Bugs that are actual bugs. This is not one of them.
    Not exposed API from Physx is nasty, but there's workarounds.


    TL;DR:
    - Don't attach rigidbody to CC, use only one of them;
    - Code your custom physics (yes, it involves even coding "forces"). There's none right now, from what I've seen above;
    - Read manual again;
     
  4. SeriouSerg

    SeriouSerg

    Joined:
    Jan 27, 2013
    Posts:
    49
    What are you talking about? What forces!

    You do not understand what you are talking about, the CC must perform the functions of detecting a collision with stationary objects and moving kinematic objects and it does this without any scripting. Two npc with CC successfully prevent collisions with each other. What we see is a fierce bug that was not in either Unity4 and Unity5, but appeared in 2017, so, dont powder my brain.

    P.S. If you see, the rigidbody was attached to kinematic wall, not to CC.
     
  5. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,294
    CC is not supposed to respond to those collisions on it's own. Read manual ffs, it's already mentioned there.

    If you want ANY responses -> you need to CODE them.

    If you're blind, here you go, quote from manual:
    Again:
    https://docs.unity3d.com/Manual/class-CharacterController.html

    Also:
    IT NEVER REACTED IN ANY VERSION OF UNITY

    I get it. Reading is hard. Sometimes you just want to blame the engine for what it's not doing for you.

    "Unity has a terrible bug! It doesn't do what I want!"

    ...

    OR you can just do it yourself.
     
    Last edited: Nov 9, 2017
  6. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    The character controller in standard assets is a rigidbody based controller, so it likely would react to moving collision geometry. However the built-in character controller is raycast based, so it needs a .move call in the direction of the geometry for it to react automatically.

    Make sure you understand which version of the character controller you are using.

    Both of them are terrible solutions so I coded my own using ComputePenetration, and recommend others follow suit. It does require competence, and it is all you need.
     
    xVergilx likes this.
  7. SeriouSerg

    SeriouSerg

    Joined:
    Jan 27, 2013
    Posts:
    49
    Do you think I did not read this?

    What you say is partially true. The CC does not respond to the dynamic bodies, but the reaction to static and slow kinematics has always been. In the video you can see the reaction, it throws up. In earlier versions, it was thrown back towards the movement. If you follow the manual, then the reaction shouldn't be at all.

    That is, neither two nor one and a half - the CC is in fact unusable and as always it is necessary to reinvent the wheel.

    About the "do it yourself", Yes I can do it, but why I have an engine, where all through the ass and the set of build-in components is not actually usable?
     
  8. SeriouSerg

    SeriouSerg

    Joined:
    Jan 27, 2013
    Posts:
    49
    Thanks, I'll try to follow your recommendation.
     
  9. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,294
    That's interesting actually. I haven't noticed that earlier, since I've always been using custom written physics for CC.
    I guess something was changed internally in CC, so it resolves penetration not at normal movement direction, but rather always up.
     
  10. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    More likely, your maths changed so it wasn't always moving slightly.
     
  11. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,294
    ...or that :D