unity how to make two objects not collide
void OnCollisionEnter(Collision collision)
{
if (collision.gameObject.tag == "theobjectToIgnore")
{
Physics.IgnoreCollision(theobjectToIgnore.collider, collider);
}
4
10
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.
Thank you!
10
0
Are there any code examples left?
New code examples in category TypeScript