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 ...
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 ...
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):
...
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 ...
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 ...
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 ...
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 ...
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.
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 ...
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 ...
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.
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 ...
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 ...
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:
...
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.
...
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. ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
layers × 41unity × 28
c# × 7
2d × 6
collision-detection × 4
physics × 4
camera × 4
sprites × 4
tilemap × 3
sorting × 3
xna × 2
libgdx × 2
animation × 2
path-finding × 2
raycasting × 2
unity-ui × 2
tiled × 2
draw-order × 2
opengl × 1
shaders × 1
rendering × 1
algorithm × 1
movement × 1
box2d × 1
tiles × 1