- Home /
Do I need to create an "Empty" Layer for objects that will not have a collider?
So, all objects have Layers, regardless of having a Collider or not.
Let's say I have an object that will only hold a script, and will not have any colliders or rigidbodies. It will have the "Default" layer set (and that layer is used for many purposes, specially for collisions)
Even without a collider, will that affect performance in any way, or do I need to create an "Empty" Layer, and in the Physics settings untick all boxes in the Layer Matrix?
$$anonymous$$aybe someone more knowledgeable about the particulars of Unity's physics engine can chime in, but I really don't think it will make any difference. Your objects in question will not have colliders and so will already be excluded from any collisions.
I'd be surprised if the internal system checking for collisions even considers those objects when checking collisions and physics layers.
Answer by pako · Feb 23, 2018 at 07:06 PM
If your objects don't have a collider or rigidbody, you don't need to worry about layers, since the Physics Engine will not take them into consideration as @TreyH also points out.
But on the other hand, if they do have a collider, then you can use layers, and the "Layer Collision Matrix" in the Physics Manager, to define if each layer will interact with other layers.
Your answer
Follow this Question
Related Questions
Change the Layer of Colliders in specific portion of Viewport 0 Answers
Child object's collider (on a different layer) is interfering with parent Physics... 0 Answers
Ignoring collisions between a layer and a single object 0 Answers
Layers are colliding even though they are set to ignore each other 1 Answer
Colliders attached to objects on separate layers are colliding? 1 Answer