Questions tagged [collider]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
41 views

Why is my player spinning after a collision?

I've made a very simple 2D top down prototype with Unity. This is the code I use for the player: ...
1
vote
1answer
33 views

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

I am trying to create pickups, that appear after an enemy dies, and that the player can pick up, but I am running into some issues. First of all, I want the pickups to be affected by gravity, so I ...
0
votes
1answer
36 views

Which collider to use on “island” situation?

I have a 2d-top-down-unity game where the player is on an island. The shape of the island is random generated and he is not able to "escape" from the island. So which Collider should I use for ...
0
votes
1answer
25 views

Object floating on “top” of tilemap

I've made a character design and added Rigidbody 2D and Box Collider 2D to it but when I put it on top of the ground which is in ...
0
votes
1answer
15 views

Move an object with other objects connected (via joints) the right way

What is the best way to move an object with other objects connected to it via joints? Let's assume we have the following setup: A player that can move on the x and the z axis "Normally configured" ...
0
votes
0answers
17 views

Instantiated prefabs dont trigger ontriggerEnter while prefabs created not on runtime, do

I am new to unity and trying to make a bouble trouble game. I have enemy prefabs with BoxCollider with is triggered checked. I also have a shooting script. when I am trying to instantiate the enemy ...
0
votes
0answers
19 views

My colliders keep going through one another? [duplicate]

So, I have some platform with colliders and a character with a collider (everything in 2D). The problem is, while there is some noticeable effects (a certain push back) when the colliders collide, ...
0
votes
1answer
45 views

How to flatten the collider for a tilemap?

I am relatively new to game development, and am working on a simple 2D platformer. I have created a tilemap and painted some tiles for the character to walk on.. but he is getting stuck. Yes, I know ...
0
votes
1answer
29 views

How do you allow joints in a character to fall freely based on gravity?

I am building a game in Unity in which a character falls down on death. Is it possible to make the joints fall and bend based on gravity? That is to leave the joints fully dependent on gravity and ...
0
votes
0answers
21 views

Convert 2D lighting script to use 2D colliders instead of 3D

I have been trying to make a 2D lighting system and successfully been able to implement it. My script has been built for 3D meshes and not for 2D , so I have to create a 3D collider for each of the ...
0
votes
1answer
67 views

How to enable the option “edit physics shape” in the Sprite Editor?

I can successfully import .png files, create tilesets, and use them in my tilemaps in Unity. Thanks to DMGregory, I just learned that there exists an option to ...
0
votes
0answers
19 views

Is there a way to organize colliders? [duplicate]

I am using a tilemap to design levels for my game in Unity. So, naturally, I need some circle/box colliders to interact with the objects in the game. I know that if I use a prefab for every tile, I ...
0
votes
0answers
24 views

Creating valid virtual creature with 3d Boxes

I'm creating this project in unity.Karl Sims, the creator of the project, published the paper describing the project. In order to create the 3d creature like in the video, I'm using 3d boxes and ...
0
votes
0answers
14 views

Collisions work in editor but not in compile

This has been asked a few times, but none of the answers worked; also, the other questions are very old. I have an object with a mesh collider on it. In the editor, the collisions work completely fine....
0
votes
1answer
31 views

How do I get the player to collide with another object to use as a boundary?

I'm trying to make a simple game where you move a sphere from left/right and try to avoid falling cubes. If a cube touches the player (sphere), the player dies. I'm trying to set up boundaries using a ...
0
votes
1answer
54 views

Colliders slightly intersecting each other; any solution?

Consider this simple scene: In Unity, colliders slightly intersect each other. Typically, this isn't a problem. However, I want to make a custom character controller using a box collider and not a ...
1
vote
1answer
125 views

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

I would like to figure out whether a collider is in a physics layer by the name (string) I set in project settings: ...
0
votes
0answers
15 views

Elastic collisions between cubes and walls

I have a simple scene with two cubes and walls as shown bellow. The right ball starts moving with initial instant force along the x-axis and collides with the first ball and reflect off a vertical ...
0
votes
1answer
40 views

How to use a boolean to activate every item with the same tag?

I've been really stuck on this one and need some help. I've got some accessories for my player, and my goal is to have a collider, with the script attached. When the player walks into the script, the ...
0
votes
1answer
229 views

Unity's Box Collider isn't preventing an object from falling through the floor

I'm working on a little "Tower of Hanoi" AR game in Unity using Vuforia, where the game is projected onto an image target. Now I wanted to make the rings "fall" into place, so I added an invisible ...
0
votes
1answer
53 views

Vertical push doesn't let the object fall down instantly [UNITY]

An object (Wall) is continuously moving forward on the X axis with a simple script: ...
3
votes
3answers
233 views

How do you execute Trigger-collider collision only in one gameobject?

I'm trying to deal with units (generated from the same prefab) dealing damage to each other on collisions. Each Unit has both a Collider2D and a trigger on the front, that deals damage to other units ...
0
votes
1answer
58 views

Unity get reference of GameObject under another GameObject

I am trying to get reference of the object underneath my Player. I don't know if I am aproaching this correctly. Right now, I have a player simply put in the scene, like this: Then I am trying to ...
0
votes
0answers
13 views

How to add Collider to a Line Renderer in unity? [duplicate]

I have created a semicircle using a line renderer, I need to add a collider to this so whenever enemy objects hit this they get destroyed, how do I do this. Current Code ...
1
vote
0answers
40 views

2D Rigidbody with Touchscript movement in Unity won't stay in boundaries

I'm trying to make a pong game where the player has to move both paddles. They are currently set as dynamic 2D Rigidbodies (collision detection continuous) and have a box collider (is NOT trigger) ...
0
votes
1answer
41 views

How to make a collider the follows all the animations of a prefab?

I have attached a capsule collider with my player(prefab) and made a script so that when Space key is down it does the jump animation in Unity. But because of the collider not jumping with the player, ...
0
votes
1answer
22 views

'Edit Collider' exits after every adjustment

When I click the Edit Collider button I can see the collider's region and the handles to adjust it. After every adjustment (with the mouse) the collider outline disappears as Edit Collider finishes. ...
0
votes
1answer
40 views

Space game scene boundaries

I've been trying to add boundaries to my space game. I've been following this tutorial with a sphere instead of a cube, but every time I start the game and move or rotate my ship it appears outside ...
1
vote
1answer
41 views

Dragging a Rigidbody2d without moving other Rigidbodies

There are obstacles and other objects that are draggable. Colliders and dynamic rigidbodies are on the draggable object and there are colliders on the obstacles. The problem is that with the ...
1
vote
1answer
566 views

Unity: Move Collider up stairs/ramps

The bots have a simple Capsule collider which cannot tilt. Movement is applied across the horizontal axes, gravity is enabled on the rigidbody. It moves up stairs okay with steps roughly 0.2 units ...
1
vote
1answer
318 views

What is a raycast?

I use this script to build buildings on my terrain, and it works with the collider somehow. But I don't understand what it is that the raycast does to find the right place to put my building. ...
0
votes
2answers
152 views

OnTriggerEnter With First Person Controller

I'm working on an FPS for my first time. I'm creating a simple terrain and instatiating 15 cubes on my terrain. (This works fine). Each cube is named "cube" and has a static trigger collider. Here's ...
0
votes
1answer
102 views

How can I destroy trees when placing a building in an RTS?

I am developing RTS game. When I build buildings on the Terrain, any trees that were in that location end up intersecting with the building. I want to remove all trees from the building's footprint ...
1
vote
1answer
196 views

Unity Collider2D is causing the game object to disappear upon collision

I have gone through just about everything to try and isolate this bug. I have isolated it down to the enemy collider, but have not solved the issue. When my player collides with my enemy, the enemy ...
0
votes
1answer
288 views

Check If a 2D Collider Is Completely Inside / Outside of a Polygon Collider

How can I check if one 2d collider (circle, capsule, polygon etc.) is completely inside / outside of a polygon collider?
0
votes
0answers
53 views

Rotating a vehicle to match a 2D slope

I have a vehicle that needs to move on a randomly generated terrain and handle slopes. I'm not using wheels, but instead moving the vehicle with velocity. The ideal case would be if I can make the ...
1
vote
2answers
243 views

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

I created a simple stair "block" in Blender, and it's rendered correctly, but when I tick "Generate Colliders" and try to use it in a Mesh Collider, there is nothing. (Ps.: I need the real mesh as a ...
0
votes
1answer
402 views

How to know which child collider triggered in parent?

I have parent object with 3 children. Each children has one collider (BoxColliders actually) marked as triggers each one. I want to know in a OnTriggerEnter on the parent side which collider was hit. ...
0
votes
0answers
57 views

My gameObject does not move, when it returns to its original scene

I have a map where I have a 2d Ship as gameObject, which can be dragged with the finger to travel between islands and do the corresponding activities, when the player finishes playing on the island he ...
0
votes
1answer
104 views

How to change music from room to room?

In Unity 2019.3.0a2 I have a labyrinth with multiple rooms. I want the music to change when I get from one room into another. How can I do it so that music from room 1 is only hearable in room 1, and ...
1
vote
1answer
108 views

Optimizing Hitboxes

Way over 90% of the performance cost seems to be coming from colliders parented to animated bones. If I disable Motion & Animation I can spawn 20 soldiers with around 1ms cost on my mid-low end ...
1
vote
1answer
285 views

ContactFilter2D does not detect a trigger even with “use triggers” enabled

I'm Using Unity 2018.3.11f1 and I'm going crazy trying to understand why the "use triggers" variable of the ContactFilter2D is not having any effect and I'm always detecting only the non-trigger ...
1
vote
0answers
349 views

Unity2D TileMap Collider Update Optimization

I'm currently working on a 2D tile-based side-scroller (similar to Terraria). I am using Unity's TileMap feature to draw tiles onto the screen and have my player collide with them as if they were ...
0
votes
1answer
325 views

How can I add different colliders to each body part of a character in Unity?

I have been using unity game engine for about two weeks now. And I'm very interested in 3D game development. I have been learning basics of Unity and third person games. I saw many tutorials about ...
-1
votes
1answer
123 views

MoveTowards object stuck with isTrigger Collider

I am trying to have a missile seek its target once it has entered the target's trigger. The code should be fine, I think it has something to do with how the colliders are operating. I want the blue ...
1
vote
1answer
87 views

Why do my NPC's fall through the world when I select them as triggers?

I'm making a game in Unity where when the player comes into contact with an NPC it will switch scenes. I have the code for it and made sure all NPC's have rigidbody as well as using gravity and convex....
0
votes
1answer
2k views

How to transform Capsule Component in UE4?

The collision of the character with the environment only works correctly (in the eyes) when I use the original skeletal mesh. I tested it in the most varied sizes and it worked perfectly. It turns ...
0
votes
1answer
30 views

Large gap between the grabbed game object and controller

When i grab a gameobject, there is a gap between them. I have tried changing the scale of the colliders, tool handle position from global to pivot but nothing worked for me. Should i reset the pivot ...
2
votes
1answer
2k views

Unity tilemap collider not colliding with rigidbody

In the wireframe you can see the tilemap collider for this hill. The red circle falls right through however. The circle has a 2D rigidbody attached. Everything is on the Default sorting layer and on ...
0
votes
1answer
95 views

How do i prevent my player from walking through mesh collider

I have a character being moved using rigidbody.moveposition and I have an floating lowpoly island with a mesh collider. When my player walks into a steep slope or a wall, it passes right through. I ...