Search Unity

Cinemachine Collider Problem

Discussion in 'Cinemachine' started by caixiang, Jun 27, 2017.

  1. cvadiablo

    cvadiablo

    Joined:
    Jun 2, 2017
    Posts:
    19
    But I already try every params ... still can't fixed the "Thin wall" problem
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    I don't understand. Can you elaborate, please? Describe the problem and show the vcam/collider inspectors.
     
  3. cvadiablo

    cvadiablo

    Joined:
    Jun 2, 2017
    Posts:
    19
    the scene view:
    upload_2019-7-25_11-16-46.png
    the game view:
    upload_2019-7-25_11-18-33.png

    the mixed layers are include this thin wall...
    the thin wall is between the lookat point and the collider.
    but the camera still behind the wall .
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    Try reducing the collider's "minimum distance from target" setting. Obstacles closer than that are ignored.
     
  5. cvadiablo

    cvadiablo

    Joined:
    Jun 2, 2017
    Posts:
    19
    I set the "minimum distance from target" to 0.05 ... but the problem still not fix

    upload_2019-7-26_10-43-38.png
     
  6. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    Try also reducing camera radius very low.
    Does it stop happening when the wall is thicker? How thick does the wall have to be before it works?
    Where would you like the camera to be, in this situation?
     
  7. cvadiablo

    cvadiablo

    Joined:
    Jun 2, 2017
    Posts:
    19
    When the wall is thick, it will not happen. Generally speaking, if the wall is more than 0.5 m thick, there will be no problem.
    But in our game, the walls of the house are relatively thin, so when the character is inside the house, the camera is found outside the house.
     
  8. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    What happens if you also reduce camera radius to 0?
     
  9. cvadiablo

    cvadiablo

    Joined:
    Jun 2, 2017
    Posts:
    19
    I just tried to adjust the camera radius to 0.01, still can't solve the problem.
    And if the camera radius is 0, it will ignore any wall
     
  10. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    Set the Distance Limit to 0 also
     
  11. cvadiablo

    cvadiablo

    Joined:
    Jun 2, 2017
    Posts:
    19
    upload_2019-7-26_20-33-1.png

    This is my config :(
    The wall is 0.5m thin
     
  12. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    ok, thanks for that.

    Is it possible that the player geometry itself is being avoided? It helps to use the IgnoreTag setting, and to tag all the geometry of the player with it. Can you try that?

    If that doesn't help, we'll have to keep simplifying the collider parameters until it starts working again, to narrow it down.
     
  13. cvadiablo

    cvadiablo

    Joined:
    Jun 2, 2017
    Posts:
    19
    "player geometry" means Colliders or the SkinMeshs?
     
  14. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    Colliders. Just tag the player game object and all its GameObject descendents.
     
  15. cvadiablo

    cvadiablo

    Joined:
    Jun 2, 2017
    Posts:
    19
    upload_2019-7-26_20-44-2.png

    And no matter I try Ignore or NoIgnore this tag, it doesn't help...
    upload_2019-7-26_20-46-59.png upload_2019-7-26_20-47-15.png
     
  16. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    Can you try changing the collider algorithm to "pull camera forward"? That's the simplest setting. Turn off all damping. Set "collide against" to everything, and "transparent layers" to Nothing. Make everything as simple as possible.
     
  17. cvadiablo

    cvadiablo

    Joined:
    Jun 2, 2017
    Posts:
    19
    I think I understand, I misunderstood the meaning of "Transparent Layers", and then I mistakenly checked this Layer setting, causing the wall to be ignored.
    Sorry for waste your time :( my bad

    Summarize the problem of solving this "thin wall"
    1, camera radius -> 0.01
    2, limit distance -> 0
    3. Don't let the Transparent Layer contain walls
     
    Last edited: Jul 26, 2019
    Gregoryl likes this.
  18. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    No worries! Although... I wonder why it worked when the wall was thicker...
     
  19. cvadiablo

    cvadiablo

    Joined:
    Jun 2, 2017
    Posts:
    19
    I noticed that it will take effect when the camera collider collides with the wall. :)

    But very strange
    Distance Limit == 0 --> work
    Distance Limit == 0.01 --> not work
     
    Last edited: Jul 26, 2019
  20. HappyKeKe

    HappyKeKe

    Unity Technologies

    Joined:
    Feb 8, 2017
    Posts:
    1
    围观围观~