Skip to main content
4 votes
Accepted

How does layer based collision affect performance

Does making use of this setting decrease performance, or increase performance? It (generally) increases performance. If you only have a handful of colliders in a scene, this could result in a slight ...
Stephan's user avatar
  • 1,738
2 votes
Accepted

How do collisions work under the hood in Unity? Is it more performant to make (physics) Layers as specific as possible?

Does Unity do work for every pair of objects on compatible layers? Will Unity do some amount of work on each pair of compatible colliders even if they aren't near each other? No. Both the PhysX ...
DMGregory's user avatar
  • 141k
1 vote

How to disable a layer in a Tilemap's collision mask via code?

You should be able to set an empty mask. Here you are setting the mask of the layer 0 to the value 2 (which has only one bit set): ...
Theraot's user avatar
  • 28.3k
1 vote
Accepted

How to properly handle hundreds of layers of tiles

For the loading time... Why not chunks? CHUNKS! You don't need to render 400 layers. You only need to render the top one for each tile. That is, for each visible tile iterate over the layers, top to ...
Theraot's user avatar
  • 28.3k
1 vote

How does layer based collision affect performance

I could imagine it decreases it if every potential collision had to be checked for its layer. Or are those collisions completely bypassed? I don't have the first-hand knowledge about how Unity handles ...
starikcetin's user avatar
  • 5,333
1 vote

Collision filtering in Box2D: running out of bits

When I first used box2d I quickly reached the 16 bits limit :-) Then I found a solution: you don't need to use all 16 bits, you need to categorize your objects. For example, you have some grounds and ...
mourad's user avatar
  • 124
1 vote
Accepted

Collision filtering in Box2D: running out of bits

If I'm not mistaken, Box2D also has the ability to store and simulate multiple independent Worlds. So you could have one world for above-ground and a separate world for below ground, and transition ...
DMGregory's user avatar
  • 141k
1 vote
Accepted

Make non-sprite render in front of sprite

Okay, the solution was very rather simple. It was the sorting layer/order of the child of the projectile that caused it. Changing it solved the issue.
Sebastian Nielsen's user avatar
1 vote
Accepted

Unity - Apply different Near/Far clip plane value for different layer

Playing with Near/Far clip values by layers would basically mean to render every object using a different camera. Which would probably be overkill. I think what you're looking for is a custom shader ...
lvictorino's user avatar
  • 2,624
1 vote
Accepted

Unity Raycast not detecting layers

It looks as though you're trying to fire a ray with the 3D physics engine PhysX, represented by the Physics class, and expecting it to interact with a collider ...
DMGregory's user avatar
  • 141k
1 vote
Accepted

ContactFilter2D does not detect a trigger even with "use triggers" enabled

I found out that I had disabled "Queries hit triggers" on the Physics 2D configuration section. Enabling it solved my problem.
Guillem Poy's user avatar
1 vote
Accepted

Need help with sorting layers on a 2D game made in Unity

You could use the ground as a mask for the beam, but I think it will give you an unnatural looking effect. Another option is to separate the ground sprite into 2 parts with a horizontal slice right ...
Kyy13's user avatar
  • 760
1 vote

GameObject With Background Covers GameObject Without Background

Though I'm not sure why, I tried messing around, and putting the Z-radius of the X Animation behind the box, it actually showed up in front of it (with the Z-radius of the X animation being -2 and the ...
CyanCoding's user avatar
1 vote
Accepted

Assigning sprite to a sorting layer through scripting

To change the sorting layer and/or the sorting order of a sprite, just use: ...
Galandil's user avatar
  • 1,284
1 vote

Tiled2Unity depth sorting issue with multiple layers

Ok I have finally managed to come up with a solution for this one, Ill post what I did here as I could not find the information anywhere else online so hopefully it will help someone else in future. ...
WraithNath's user avatar
1 vote

Is there any way to change the layering of objects in Actionscript 3 without altering the run order?

When you say "runs the instances" what logic specifically are you talking about? You should not be processing game logic by looping over DisplayObject.children. ...
Engineer's user avatar
  • 30.4k

Only top scored, non community-wiki answers of a minimum length are eligible