Unity2D - Ignore collision with edge colliderCollisions in custom physics problemsCollision detection with bitmaps on SurfaceView's canvas in AndroidUnity3D: Recalculating collisions after Physics2D.IgnoreLayerCollision()?2D collision detection on html5 canvasCan a Polygon Collider 2D work with a Mesh Collider in Unity?How to detect collisions when using a GameObject collides with a BoxCollider 2D while being dragged on Unity 3DHow can I find on which side of an EdgeCollider2D (Unity 3D) a collision takes place?GameObject not detecting collision with floorAlternatives for updating mesh collider in runtime?Unity5 OnTriggerEnter2D not called after collision (2D game)CircleCollider2D is not registering collisions with some tiles in a TileMapCollider2D

Do universities maintain secret textbooks?

How did medieval manors handle population growth? Was there room for more fields to be ploughed?

Under GDPR, can I give permission once to allow everyone to store and process my data?

Small RAM 4 KB on the early Apple II?

How to understand payment due date for credit card?

How to investigate an unknown 1.5GB file named "sudo" in my Linux home directory?

Could a complex system of reaction wheels be used to propel a spacecraft?

Was a six-engine 747 ever seriously considered by Boeing?

Is it good practice to speed up and slow down where not written in a song?

Was it illegal to blaspheme God in Antioch in 360.-410.?

Is this homebrew "Faerie Fire Grenade" unbalanced?

Are sweatpants frowned upon on flights?

Can I lend a small amount of my own money to a bank at the federal funds rate?

Eshet Chayil in the Tunisian service

Storing milk for long periods of time

Find the logic in first 2 statements to give the answer for the third statement

Why haven't the British protested Brexit as ardently like Hong Kongers protest?

Which is the correct version of Mussorgsky's Pictures at an Exhibition?

Can inductive kick be discharged without freewheeling diode, in this example?

Are spot colors limited and why CMYK mix is not treated same as spot color mix?

Is "prohibition against," a double negative?

How can I portray a character with no fear of death, without them sounding utterly bored?

How were US credit cards verified in-store in the 1980's?

Why do presidential pardons exist in a country having a clear separation of powers?



Unity2D - Ignore collision with edge collider


Collisions in custom physics problemsCollision detection with bitmaps on SurfaceView's canvas in AndroidUnity3D: Recalculating collisions after Physics2D.IgnoreLayerCollision()?2D collision detection on html5 canvasCan a Polygon Collider 2D work with a Mesh Collider in Unity?How to detect collisions when using a GameObject collides with a BoxCollider 2D while being dragged on Unity 3DHow can I find on which side of an EdgeCollider2D (Unity 3D) a collision takes place?GameObject not detecting collision with floorAlternatives for updating mesh collider in runtime?Unity5 OnTriggerEnter2D not called after collision (2D game)CircleCollider2D is not registering collisions with some tiles in a TileMapCollider2D






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I am trying to have my player ignore the collision with an edge collider on a platform i have.



Here's the script that I have added to the player



public class TestMovement : MonoBehaviour

public Rigidbody2D ball;
private GameObject purplePlat1;
private GameObject player;

// Start is called before the first frame update
void Start()

purplePlat1 = GameObject.Find("purple_plat");
player = GameObject.Find("circle-png-44659");

ball = GetComponent<Rigidbody2D>();
ball.AddForce(new Vector2(0, 10), ForceMode2D.Impulse);
Debug.Log("start");


// Update is called once per frame
void Update()




void OnCollisionEnter2D(Collision2D collision)


Physics2D.IgnoreCollision(purplePlat1.GetComponent<EdgeCollider2D>
(), GetComponent<CircleCollider2D>());
Debug.Log("collision");





The ball is still hitting the platform. I have confirmed that the oncollisionenter method is firing.



enter image description here



enter image description here










share|improve this question
























  • You should just put the IgnoreCollision in Start(). It remains in effect until you set it to false.

    – ryeMoss
    Mar 27 at 23:34







  • 1





    on collision is called on the collision, in other words, too late to be ignored. its like telling people who come to your house not to come to your house. they are already there. you need to tell them before they come.

    – Tomer Shahar
    Mar 28 at 7:48

















0















I am trying to have my player ignore the collision with an edge collider on a platform i have.



Here's the script that I have added to the player



public class TestMovement : MonoBehaviour

public Rigidbody2D ball;
private GameObject purplePlat1;
private GameObject player;

// Start is called before the first frame update
void Start()

purplePlat1 = GameObject.Find("purple_plat");
player = GameObject.Find("circle-png-44659");

ball = GetComponent<Rigidbody2D>();
ball.AddForce(new Vector2(0, 10), ForceMode2D.Impulse);
Debug.Log("start");


// Update is called once per frame
void Update()




void OnCollisionEnter2D(Collision2D collision)


Physics2D.IgnoreCollision(purplePlat1.GetComponent<EdgeCollider2D>
(), GetComponent<CircleCollider2D>());
Debug.Log("collision");





The ball is still hitting the platform. I have confirmed that the oncollisionenter method is firing.



enter image description here



enter image description here










share|improve this question
























  • You should just put the IgnoreCollision in Start(). It remains in effect until you set it to false.

    – ryeMoss
    Mar 27 at 23:34







  • 1





    on collision is called on the collision, in other words, too late to be ignored. its like telling people who come to your house not to come to your house. they are already there. you need to tell them before they come.

    – Tomer Shahar
    Mar 28 at 7:48













0












0








0








I am trying to have my player ignore the collision with an edge collider on a platform i have.



Here's the script that I have added to the player



public class TestMovement : MonoBehaviour

public Rigidbody2D ball;
private GameObject purplePlat1;
private GameObject player;

// Start is called before the first frame update
void Start()

purplePlat1 = GameObject.Find("purple_plat");
player = GameObject.Find("circle-png-44659");

ball = GetComponent<Rigidbody2D>();
ball.AddForce(new Vector2(0, 10), ForceMode2D.Impulse);
Debug.Log("start");


// Update is called once per frame
void Update()




void OnCollisionEnter2D(Collision2D collision)


Physics2D.IgnoreCollision(purplePlat1.GetComponent<EdgeCollider2D>
(), GetComponent<CircleCollider2D>());
Debug.Log("collision");





The ball is still hitting the platform. I have confirmed that the oncollisionenter method is firing.



enter image description here



enter image description here










share|improve this question














I am trying to have my player ignore the collision with an edge collider on a platform i have.



Here's the script that I have added to the player



public class TestMovement : MonoBehaviour

public Rigidbody2D ball;
private GameObject purplePlat1;
private GameObject player;

// Start is called before the first frame update
void Start()

purplePlat1 = GameObject.Find("purple_plat");
player = GameObject.Find("circle-png-44659");

ball = GetComponent<Rigidbody2D>();
ball.AddForce(new Vector2(0, 10), ForceMode2D.Impulse);
Debug.Log("start");


// Update is called once per frame
void Update()




void OnCollisionEnter2D(Collision2D collision)


Physics2D.IgnoreCollision(purplePlat1.GetComponent<EdgeCollider2D>
(), GetComponent<CircleCollider2D>());
Debug.Log("collision");





The ball is still hitting the platform. I have confirmed that the oncollisionenter method is firing.



enter image description here



enter image description here







unity3d collision-detection






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 27 at 23:08









JohnJohn

7510 bronze badges




7510 bronze badges















  • You should just put the IgnoreCollision in Start(). It remains in effect until you set it to false.

    – ryeMoss
    Mar 27 at 23:34







  • 1





    on collision is called on the collision, in other words, too late to be ignored. its like telling people who come to your house not to come to your house. they are already there. you need to tell them before they come.

    – Tomer Shahar
    Mar 28 at 7:48

















  • You should just put the IgnoreCollision in Start(). It remains in effect until you set it to false.

    – ryeMoss
    Mar 27 at 23:34







  • 1





    on collision is called on the collision, in other words, too late to be ignored. its like telling people who come to your house not to come to your house. they are already there. you need to tell them before they come.

    – Tomer Shahar
    Mar 28 at 7:48
















You should just put the IgnoreCollision in Start(). It remains in effect until you set it to false.

– ryeMoss
Mar 27 at 23:34






You should just put the IgnoreCollision in Start(). It remains in effect until you set it to false.

– ryeMoss
Mar 27 at 23:34





1




1





on collision is called on the collision, in other words, too late to be ignored. its like telling people who come to your house not to come to your house. they are already there. you need to tell them before they come.

– Tomer Shahar
Mar 28 at 7:48





on collision is called on the collision, in other words, too late to be ignored. its like telling people who come to your house not to come to your house. they are already there. you need to tell them before they come.

– Tomer Shahar
Mar 28 at 7:48












2 Answers
2






active

oldest

votes


















0















You can use the layer system of Unity to avoid collisions between both. Set a layer for a player and another for the edge and untick the collision between them.






share|improve this answer
































    0















    What you can do is create a layer mask for the different type of game objects. Then, open your Physics2D settings.



    Physics2D settings



    On the bottom part, you can see a matrix of physics objects that can collide to one another. Just uncheck which layer should not collide with the other.



    Matrix






    share|improve this answer



























      Your Answer






      StackExchange.ifUsing("editor", function ()
      StackExchange.using("externalEditor", function ()
      StackExchange.using("snippets", function ()
      StackExchange.snippets.init();
      );
      );
      , "code-snippets");

      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "1"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55387846%2funity2d-ignore-collision-with-edge-collider%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0















      You can use the layer system of Unity to avoid collisions between both. Set a layer for a player and another for the edge and untick the collision between them.






      share|improve this answer





























        0















        You can use the layer system of Unity to avoid collisions between both. Set a layer for a player and another for the edge and untick the collision between them.






        share|improve this answer



























          0














          0










          0









          You can use the layer system of Unity to avoid collisions between both. Set a layer for a player and another for the edge and untick the collision between them.






          share|improve this answer













          You can use the layer system of Unity to avoid collisions between both. Set a layer for a player and another for the edge and untick the collision between them.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 28 at 0:27









          FollarinFollarin

          631 silver badge8 bronze badges




          631 silver badge8 bronze badges


























              0















              What you can do is create a layer mask for the different type of game objects. Then, open your Physics2D settings.



              Physics2D settings



              On the bottom part, you can see a matrix of physics objects that can collide to one another. Just uncheck which layer should not collide with the other.



              Matrix






              share|improve this answer





























                0















                What you can do is create a layer mask for the different type of game objects. Then, open your Physics2D settings.



                Physics2D settings



                On the bottom part, you can see a matrix of physics objects that can collide to one another. Just uncheck which layer should not collide with the other.



                Matrix






                share|improve this answer



























                  0














                  0










                  0









                  What you can do is create a layer mask for the different type of game objects. Then, open your Physics2D settings.



                  Physics2D settings



                  On the bottom part, you can see a matrix of physics objects that can collide to one another. Just uncheck which layer should not collide with the other.



                  Matrix






                  share|improve this answer













                  What you can do is create a layer mask for the different type of game objects. Then, open your Physics2D settings.



                  Physics2D settings



                  On the bottom part, you can see a matrix of physics objects that can collide to one another. Just uncheck which layer should not collide with the other.



                  Matrix







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Mar 28 at 7:29









                  TrickoTricko

                  2111 silver badge5 bronze badges




                  2111 silver badge5 bronze badges






























                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55387846%2funity2d-ignore-collision-with-edge-collider%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                      SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                      은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현