Share Your Experience: Take the 2024 Developer Survey

# Tag Info

Accepted

### How is a Mesh Collider "performance expensive"?

A moving body near a meshcollider needs to check for collisions against potentially every triangular face of the mesh. So for a detailed or non-convex mesh, or lots of bodies, this can get expensive. ...
• 135k
Accepted

### Solving obtuse interior corner collisions

There is an alternate way to think about solving this. You can do a transform by offseting the lines by radius of your circle then the solution is same as intersection of 2 lines. Image 1: You can ...
• 399

### Solving obtuse interior corner collisions

I assume that you want a solution for collisions in general, which also works well for interior corners. When resolving a collision against one plane, do not move the circle perpendicular to the plane....
• 5,498
Accepted

### Nestling into contact with a group of physics objects without exerting forces on them

Here's a way to do this using Physics.SphereCast to test against the bodies' colliders without actually exerting any forces on them. It assumes that your cursor object is placed on exactly the same y ...
• 135k
Accepted

On picking your tutorials You seem to have been mixing Godot 3 and Godot 4 tutorials. So be careful which one the tutorial is for. Chances are that tutorials prior to Godot 4 don't specify. At the ...
• 27k
Accepted

### Why is OnTriggerEnter not called when my objects do not have Rigidbodies?

As you can see from the Collision action matrix in the documentation: Trigger messages are sent upon collision StaticCollider RigidbodyCollider KinematicRigidbodyCollider StaticTriggerCollider ...
• 135k

### How is a Mesh Collider "performance expensive"?

Unity first uses Axis-Alligned Bounding Boxes (AABB) to check which colliders actually have a chance to collide. Checking two AABB's for intersection is a very cheap operation. Only then does Unity ...
• 120k

### Godot: How do I get the id mask for a physics layer by name?

Just a demo in an empty node - range starts with 1 up to the number of layers It creates a dictionary where you can access with layer name and get the number as 2 to the power of layer number - run ...
Accepted

### Show colliders in a build game in Unity

Gizmos are only visible in the Editor, so that is not a solution. Instead, you can render the colliders or (simulate rendering them) any number of ways. BoxCollider2D If your 2D colliders are boxes, ...
• 1,690

### How is a Mesh Collider "performance expensive"?

A Mesh Collider will have to figure out the collisions for every single face of the whole mesh, Therefore It would take Longer (No significant difference most of the time) and would consume more ...
Accepted

### Unity - An unwanted Collider , far too big , being added to meshes without reason and I cannot remove it

Well that collider might not even belong to the game object you are currently selecting, try to go through each game object that is a child object and you'd probably find it. And when you do you can ...
Accepted

### How to change music from room to room?

If you want to play non-diegetic music (background music which just plays without a positional source), then a simple solution is to add the audio source which plays that music directly to the camera. ...
• 120k
Accepted

### What is a raycast?

A raycast is like shining a laser pointer in your scene, to see what the laser hits. It takes a starting point and a direction as input (together, they make a "ray"). The physics engine takes this ...
• 135k
Accepted

### Godot: How do I get the id mask for a physics layer by name?

Getting layer via name is not possible as of Godot v3.2.1. However, you can use groups and the logic will be the same. Add the wall collision objects to a "Walls" group and then check if it's in the ...
• 331
Accepted

### How to prevent an object with high velocity from passing through a collider?

To prevent a collider from passing through another collider at high velocity, change the "Collision Detection" option on its "Rigidbody 2D" from "Discrete" (default) to &...
• 151

### Solving obtuse interior corner collisions

To find the position where the circle is resting against both planes, you could use following approach: We define the line k which is the bisector of the angle between g and h. Every point on line k ...
Accepted

### How to make the player pass through only certain objects, but not others?

You can go to Edit->Project Setting->Physics or Physics 2D->Layer Collision Matrix. To change what you want your player pass through or not. To change it via code like what you wanted, I have ...
Accepted

### Unity tilemap collider not colliding with rigidbody

I forgot to put a circle collider on the red circle. Leaving this up for others who might run into the same problem.
Accepted

### Changing CharacterController's height causes jittering issue in Unity

I'm assuming this is the issue you're having: You can fix this by offsetting the CharacterController's center so that the bottom of the collider is always at the foot of your character. Specifically, ...
• 263
Accepted

### Mesh made in Blender is correct in Unity3D as a rendered mesh, but "empty" as a collider?

this is just a guess that I am pulling out. but I see a missing line on the side of your stairs. No line showing up in unity seems like a hint. you can see triangles 012, 234, and 145 because of the ...
• 229
Accepted

### Which collider to use on "island" situation?

An EdgeCollider2D would handle this case well. Much like a LineRenderer, you provide it a list of points to join into line segments, marking your collision boundary. It can be a closed shape, but it ...
• 135k
Accepted

### Making pickup objects with gravity that won't push the player on collision

Set the pickup to be on a layer that interacts with the ground only, not the player character. Give your player character a child object that represents their collection radius. Give it a trigger ...
• 135k
Accepted

### Collision objects aren't preventing falling in Unity

Check the Layer Collision Matrix of your Physics 2D project settings to make sure the "Default" layer reacts to itself. I've seen this mysteriously get ...
• 1,690
Accepted

### My sprite is hovering slightly above my tilemap in Unity 2D

There are several ways to fix this: 1- Go to Project Setting and then Physics 2D and change the value of Default Contact Offset to something smaller 2- make the collider slightly smaller than the ...
• 691
Accepted

### two colliders for same trigger are conflicting

If there's only one thing (the player) these triggers interact with, you can do something like this: ...
• 135k

### How to ignore collisions of triggers after first collision of trigger until OnTriggerExit of first collision of trigger?

I think it should be as easy as: if (whitettank.gameObject.tag == "whitetank" && !red.isStopped) { // do stuff } This way the script will skip over ...
• 219

### Nestling into contact with a group of physics objects without exerting forces on them

If your problem here is that when player is placing the ball, it pushes other balls back, then why not just turn isKinematic on and off? Turn off physics for all the other balls on the playing field, ...
• 3,126
Accepted

### Every Item is colliding but 1

So comparing bullet and player I learned bullet worked because it wasn't a trigger so I set my player object to not be a trigger and now it works, Im embarrassed Lol.