Search Unity

How to use Physics.IgnoreLayerCollision

Discussion in 'Scripting' started by UMURAS, Jan 15, 2020.

  1. UMURAS

    UMURAS

    Joined:
    Jun 15, 2019
    Posts:
    18
    I want to prevent objects falling down from colliding in the air
    I created 2 layers named apple1 and apple2 but it doesn't work.
    void Update ()
    {
    physics.ıgnorelayercollisio the (8,9);
    }

    But it didn't work, can you help?
     
  2. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,775
    1. Use code tags when posting code
    2. When posting code that has a problem, copy and paste the exact code, don't try and retype it. (and, I'm going to take a stab in the dark, especially don't try and retype it on a phone? It sure looks like autocorrect inserted a "the" there) When you retype it, that can introduce any number of new issues that will probably hide the actual problem. (in this case, capitalization and a bizarre "the" inserted for no apparent reason)
    3. Specifically say what you mean by "didn't work". Does it give you a compiler error? Does it have no effect?
     
  3. UMURAS

    UMURAS

    Joined:
    Jun 15, 2019
    Posts:
    18
    I'm sorry for the way of expression, the game is a team game to put the picture I couldn't tell properly in the form of writing a bit ridiculous, thank you for the suggestions.
     
  4. UMURAS

    UMURAS

    Joined:
    Jun 15, 2019
    Posts:
    18
    What I really want is how this ignorecollision is used for a single object?