unity how to make two objects not collide

 void OnCollisionEnter(Collision collision)
  {
      if (collision.gameObject.tag == "theobjectToIgnore")
      {
          Physics.IgnoreCollision(theobjectToIgnore.collider, collider);
      }


4
10
VividD 120 points

                                    Create a new layer called "Enemies" and have it
be the layer of all your enemy gameobjects. Then
take a look at the Physics Layers settings under
Edit/Project Settings/Physics, 
and disable collisions for objects 
in the Enemies layer with other 
objects in that same layer. 

4 (10 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
how to detect collision of some other gameobject unity how to detect collision of a gameobject unity unity collision detection one time unity detect collision of other object how continiously detect collision in unity unity detect collision only one object unity manual collision detection how to detect object collision in different script unity Unity ways to detect collision unity on collision with specific object how to detect collision with instance unity unity collision detection from to other objects unity collision detection from to other objeczs how to detect collision with a certain object in unity how to detect collision sides unity collision detection codee for 2 objects unity unity collision detection layer unity collision detection 3d Layer-based collision detection unity unity two objects collide unity detect collision with specific object instance unity2d make two objects not collide unity make two objects not collide 2d unity detect collision side unity detect collision with specific object how to do collision detection in unity unity 2 objects wont collide unity collision with specific object unity how to make your own collision detection unity get gameobject on collision how to make two objects not collide unity how do unity detection collision unity collision detection which is best why are objects not collide with each other unity unity different collision detection type how to detect what side a collision is coming from in unity unity how to detect collision from another game object how to detect Side object collision ini unity unity collision detection unity detect collision unity detect collision between two objects in another object get one collision unity collision detection unity 3d collisiond detection unity 3d get collision object unity unity rigidbody collision detection players dont collide unity collision detection unity how to make sertain objects not collide with each other unity Unity access components on collision make object collide only with specific object unity make object collide only with specific object unity collision detection 2d how to detect collision in unity collision detection between two players in unity unity how to put collision on layer script unity point light not working between two colliders unity how to set which colliders collide with what unity only get collision from unity unity all objects in collider unity collision on on eside unity disable collision between two objects unity 2d how to desable collision with a certain object temporarly ignore collision with tag unity unity not collide with currten objects 2 objects are not colliding each other unity how to make two objects not collide unity collision matrix hwo to get what objects are colling with anoteh robject unity3d unity make certain objects not collide unity collider 2d only certain layers does unity handle 3d collision better unity make object not collide with specific object make certain objects not collide with each other unity how to do collision detection with one object unity make two objects not collide layer not collide unity unity bind two objects without rigidbody unity join two objects without rigidbody how to make 2 players dont collide unity
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source