#Disable collision between two objects

1 messages · Page 1 of 1 (latest)

sonic remnant
#

Hello, I want to disable the collision of two objects in Unity. In particular I have a ball object and a wall object which I do not want collide.

The ball is on layer "Ball" and has a Sphere Collider + Rigidbody
The wall is on layer "Default" and has a box collider.

In the layer collision matrix I disabled the Default / Ball cell.

Does anyone has an idea what I am doing wrong?

mossy dawnBOT
# sonic remnant Hello, I want to disable the collision of two objects in Unity. In particular I ...

Hello there – I'm an AI powered assistant 🤖 that might be able to help you with your question. Would you like me to try helping you?

💡 Did you know that we now also have a forum with AI support? Join now with your discord account!

How it works:
Reply to the messages of the bot that end with a thread_id to interact with it and ask follow-up questions. You can also mention the bot directly in this channel to get help.

Help requested: please wait a moment...

mossy dawnBOT
mossy dawnBOT
# sonic remnant Hello, I want to disable the collision of two objects in Unity. In particular I ...

Hello Marcel, it seems you're working with Unity and trying to prevent collisions between two objects by adjusting the Layer Collision Matrix. Your approach is correct by setting the ball on the "Ball" layer and the wall on the "Default" layer, then disabling collisions between these two layers in the Layer Collision Matrix.

However, if you're still experiencing collisions, here are a few steps to double-check:

  1. Ensure Layers Are Correctly Assigned: Verify that the ball is indeed assigned to the "Ball" layer and the wall is assigned to the "Default" layer. This assignment needs to be done in the Unity Editor by selecting each object and setting their layer from the dropdown at the top of the Inspector.

  2. Recheck the Layer Collision Matrix: Go to Edit > Project Settings > Physics (for 3D) or Physics 2D (for 2D) and ensure the cell intersecting the "Ball" row and the "Default" column is unchecked. Sometimes changes might not save correctly or might be mistakenly re-enabled.

  3. Check Child Objects: If your ball or wall has child objects, make sure that those children are also set to the correct layers. Layer settings on parent objects do not automatically propagate to children.

  4. Collider and Rigidbody Settings: Ensure that both your ball and wall have their colliders and (if present) Rigidbody components correctly configured. For example, ensure that the ball's Rigidbody is not set to Kinematic if you expect it to respond to physics-based collisions (or lack thereof).

  5. Scripted Collisions: Verify that there are no scripts dynamically changing the layer of the objects at runtime or manually handling collision responses that might override the Layer Collision Matrix settings.

thread_EWLRGQOu3DcA8qoxNRkwaJ0u

mossy dawnBOT
# sonic remnant Hello, I want to disable the collision of two objects in Unity. In particular I ...
  1. Restart Unity Editor: Sometimes, Unity might not correctly apply changes until after a restart of the Editor. After making your changes, try closing and reopening your project.

By following these steps, you should be able to resolve any lingering issues with your collision settings. If the problem persists, consider reviewing any related Unity documentation on collision layers and possibly reaching out on Unity-specific forums or communities with detailed information about your setup.

1 messages left
thread_EWLRGQOu3DcA8qoxNRkwaJ0u

primal summit
#

We currently dont export the unity physics matrix so thats why you have to use this little extra component

sonic remnant
primal summit
#

Theres a small button at the bottom of each collider component (sorry just on mobile so cant send a screenshot rn)

sonic remnant
#

Found it! I was on version 3.31.8 where the component was not added yet. I found the component now in version 3.33.0-pre and will try it out now.

primal summit
#

Ah sorry i thought we added it already to 31. Glad you found it. The tooltips have some information how to use it

sonic remnant
#

So I added a Collider Data component both to the ball and the wall. The ball has Membership Group_1 and Filter is set to everything but Group_0. The wall has Membership Group_1 and filter is set to everything but Group_1. But unfortunately the ball still collides with the wall. Did I configure it correctly?

#

(now on the latest experimental version running in chrome)