Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [collider]

Colliders are geometric proxies used in collision detection. Colliders are usually simple shapes (e.g. spheres, boxes, capsules, and their 2D counterparts) that work best with collision detection algorithms compared to the high-poly 3D meshes they approximate alone or combined.

51 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3 votes
0 answers
970 views

Zooming in a lot without having 3D objects disappear in the Unity Editor

I'm editing the 2D colliders on some objects of my game, and I need them to be very accurate, so I'm zooming in a lot. Problem is, since my objects are 3D graphically, when I zoom in a lot they ...
Eärendil Baggins's user avatar
3 votes
0 answers
151 views

Line Renderer 2d Follow the edge

I am using mouse position to draw a line using line renderer 2d. What i want is when the line hits a collider it should start to draw on the edge of the collider rather than over the collider. ...
Shahan Butt's user avatar
3 votes
0 answers
139 views

Unity: Messages in Compound Colliders

Lets say I have a 2D character with two colliders: a circle collider that represents the feet, and a box collider that represents the body. Lets say that the character is currently standing on the ...
ViggyNash's user avatar
  • 191
2 votes
0 answers
1k 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 ...
Ben Mroz's user avatar
1 vote
0 answers
1k views

No Collision while rotating. Object rotating with Rigidbody.Rotate passes through other collider

I'm working on a 3D game, and having issues with the colliders. My Cube Controller has movement input by keyboard, with collider and rigidbody components. Cylinder objects have basic colliders and ...
Sheath9's user avatar
  • 11
1 vote
0 answers
228 views

Unity - How to implement water trigger?

I want my character to change the movement mode to swimming whenever he enters Water. So I used the OnTriggerEnter to check if the other collider is my water volume, and if so, change movement mode to ...
Alexandre Marcati's user avatar
1 vote
0 answers
41 views

How can I make this motion collide against a wall

EDIT I've actually commented out the motion in my code and adapted it to try reproduce this post.After a chat with @DMGregory he told me to use velocity reflection but as you can see in the following ...
JSmith's user avatar
  • 123
1 vote
0 answers
756 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 ...
Confused's user avatar
1 vote
0 answers
80 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) ...
Shelbert Miller's user avatar
1 vote
1 answer
86 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 ...
MContributor's user avatar
1 vote
0 answers
40 views

Box collider has different behavior in 2 clients

I'm new to Unity. I am making my first Game and faced with problem. I have a plane and 4 gameobject that has box collider surrounded this plane. there are a few spheres as players inside of the plane....
s.john's user avatar
  • 31
1 vote
0 answers
37 views

Capsule collider triggered unexpectedly

I have an object with a capsule collider on its root, with IsTrigger=true (triggered by the player). The trigger works fine, but is also triggered unexpectedly some ...
Ruud van Falier's user avatar
1 vote
0 answers
440 views

How can I get visually accurate collision normals with sphere collisions?

I'm solving simple 3D sphere collisions by checking the sphere for overlap with a mesh, finding the nearest point on that mesh's surface to the center of the sphere, and then resolving the collision ...
IanLarson's user avatar
  • 771
1 vote
0 answers
155 views

Detect when any part of a collider leaves a trigger zone on Unity 3D

I've searched all over for a simple solution on this, and found posts as old as 2011, with a bunch of hackish ways to badly work this out. I want to detect when ANY part of a collider leaves a ...
sigmaxf's user avatar
  • 145
1 vote
0 answers
1k views

Unity Generating PolygonCollider from mesh

I generated a procedural mesh using marching squares and the MeshFilter component (it's 2 dimensional). Now I got the point that I need do collision detection with ...
Bálint's user avatar
  • 14.9k
1 vote
1 answer
750 views

Unity3d How to add collider to borders

I have a box with a hole in it. Is it posible to add a collider only to the dark blue showed at the img? (But only at the borders, not a box collider. Let's say i want some object to get in the box, ...
ziad.ali's user avatar
  • 113
0 votes
0 answers
25 views

Player-Environment Interaction & Collision Handling in Unity

Simply put, how would you go about designing environmental interactions? For example, upon pressing the interact button when near a chair, he can sit on it. (Also works with NPCs functioning with <...
NotLucifer's user avatar
0 votes
0 answers
27 views

How to implement flexible, deformable shapes?

I'm making a top-down, 2D wargame that simulates large numbers of troops fighting. Instead of taking the Total war approach and modelling each soldier individually, I represent them as 1000-man ...
DeeCeptor's user avatar
  • 255
0 votes
0 answers
50 views

Collision between a sprite and a rect in PyGame

I'm trying to make a simple platformer game, which has code to move the camera towards a player as they jump around. Now I have two classes: one for the player, and one for the platform. In the ...
Divyansh undley's user avatar
0 votes
1 answer
93 views

Wheel Colliders falling through ground

I have read through hours of forums and tried everything, But this issue still persists. I have attached a video showing the issue as well as all of my collider settings. Any help would be appreciated....
son goku's user avatar
0 votes
0 answers
28 views

PolygonCollider2D components do not work properly in iOS build

I'm trying to figure out why my polygon colliders default to pentagon shapes when I build my app and test it on a device. I have a scene with some blocks you can drag around where the colliders work ...
KD867746's user avatar
0 votes
0 answers
64 views

Physics2D.OverlapBoxAll misses small overlap

I have a tetris-like 2D game with tiles, each made up of a sprite, a Rigidbody2D and a BoxCollider2D. The tiles fall from the ...
ChrisC's user avatar
  • 116
0 votes
0 answers
114 views

Box Collider on terrain trees activate far from the actual collider

The trees are prefabs but are placed as terrain trees. There is a space ship that explodes when hits the tree. The moment I got the screenshot is the moment that the ship collides with terrain (the ...
shampoo's user avatar
  • 101
0 votes
0 answers
79 views

Alternative to CharacterController

I am really enjoying the use of charactercontroller, but it being limited by a y-axis aligned collider is a real annoying limitation when I am using a 'character' with a very different shape (like a ...
Weckar E.'s user avatar
  • 832
0 votes
0 answers
151 views

Possible to completely deactivate a RigidBody 2D component so that the Composite Collider on a parent object works?

In my Unity game, I have two GameObjects with the tag "Animal": Snake and Tiger, nested like so:. Snake Tiger I have a Composite Collider 2D/RigidBody 2D on both the parent GameObject (...
kanamekun's user avatar
  • 369
0 votes
0 answers
198 views

2D circle and rotated square collision detection and response

I'm creating a 2D multiplayer game in javascript, but I'm actually struggling with a problem (not really a problem, but I don't know how to do). I'm actually trying to make my player (circle hitbox) ...
DarePhoenix's user avatar
0 votes
0 answers
96 views

How to display the Composite Collider to a player

I have a GameObject with a Composite Collider on it. There are 2 nested GameObjects under it, each with a Sprite: I am making an educational game, and for pedagogical reasons I'd like to display the ...
kanamekun's user avatar
  • 369
0 votes
0 answers
309 views

My sphere falls through the floor which is made in blender

I am developing a game with a club, and yesterday I requested a floor with a hole and the people from the art team made one for me and gave it to me in a .fbx ...
Susie Xue's user avatar
0 votes
1 answer
141 views

BoxCollider2D used as reference to Collide with GameObjects but it uses the original size Sprites size to Collide

I'm a beginner in Unity and pretty much copy and pasted the code but I can't figure out why the game is using the size of the sprite and not my BoxCollider2D as a ...
IRannoxI's user avatar
0 votes
0 answers
47 views

How to change fall delay of a gameobject by time?

I want my gameobjects to fall faster by time as the player collides with them. What I mean is, when the game starts, the gameobjects fall off after 1 second the player collided with them, but after 60 ...
imbruceter's user avatar
0 votes
0 answers
27 views

What are the tradeoffs I should consider when choosing how to track whether a GameObject is out of bounds? (Unity 3D)

The obvious ways are to either: OnTriggerExit for a box collider which wraps the stage bounds OnTriggerEnter for 6 flat box colliders surrounding the stage I suppose, to start, 6 flat boundaries ...
pixelpax's user avatar
  • 143
0 votes
1 answer
191 views

What is an alternative solution to the problem of polygon collider2D not following character (animation)movement?

A 2D game and a bird's eye view of the character. This character, who has a knife in his hand, swings the knife by waving his arm, just at this time, I look at "polygon collider2d" from the ...
gunza's user avatar
  • 13
0 votes
0 answers
16 views

one collider for 2 combined object

I have an obstacle that composed of 2 game object, but when the player collides it, it gets in OnTriggerEnter twice when the obstacle have 2 different collider, which is what it should be, of course. ...
anónimo's user avatar
0 votes
0 answers
51 views

Circle collider wheels push through polygon collider car chassis

I'm trying to create a simple vehicle and make it run on a terrain (from sprites + PolygonCollider2D). I imported a chassis sprite with ...
Maifee Ul Asad's user avatar
0 votes
0 answers
88 views

Collider inside another collider: Move the brain via mouse while being able the click the spheres

The spheres have a sphere collider on them and are clickable via this script:Clickable.cs ...
ASE Lab's user avatar
0 votes
0 answers
803 views

(Unity) how to write my own raycasting functions

I am making a game in curved space in Unity and I am trying to figure out the best way to handle raycasting. For my purposes the Ray struct doesn't carry enough ...
A. Kriegman's user avatar
0 votes
1 answer
113 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 ...
Saiansh Singh's user avatar
0 votes
0 answers
53 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 ...
Koby 27's user avatar
  • 141
0 votes
1 answer
484 views

How to get reference to board tile object another game object is sitting on?

I am trying to get reference of the object underneath my Player. I don't know if I am approaching this correctly. Right now, I have a player simply put in the scene, like this: Then I am trying to ...
anon's user avatar
  • 101
0 votes
1 answer
128 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. ...
BanksySan's user avatar
  • 200
0 votes
0 answers
401 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 ...
ddd555's user avatar
  • 13
0 votes
0 answers
59 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 ...
Nicolas Flores Muñoz's user avatar
0 votes
0 answers
1k views

Is a simple PolygonCollider2D really worse than several BoxCollider2Ds?

In my scene I have very simple quadrilateral blocks, which I'm considering using PolygonCollider2D for. These blocks will be the building blocks of the scenery so ...
Eärendil Baggins's user avatar
0 votes
0 answers
28 views

Unity: finding force vector to separate colliders in OnTriggerStay events

In Unity, I have Trigger Colliders, and catch the OnTriggerStay(Collider other) events. Once two Colliders are touching, how do I get the Force vector to make them want to separate again? In the ...
Kim's user avatar
  • 1
0 votes
0 answers
35 views

How do I transform from local points to world when using a scroll view?

I'm using a scroll view to store my game character icons (basically an RPG). The movement system for the characters is tile based, but in game hazards could be located anywhere. So I need to detect if ...
Allan Mills's user avatar
0 votes
0 answers
1k views

Detecting collisions without rigidbody

I have a car with the following aspect: As you can see, colliders are locally static, because they are separated from the original rigidbody component. Well, as you can suppose, I have a problem, ...
z3nth10n's user avatar
  • 141
0 votes
0 answers
64 views

Marking up 2D polygon perimeter on an image

I'm working on a 2D game in JavaScript using the Web canvas. I plan to use AABB proximity detection and then point, line and polygon on polygon collision detection. Which means I need to define ...
Shavais's user avatar
  • 111
0 votes
0 answers
72 views

Get number of sides of a shape created with LineRenderer in Unity

In my game I'm using LineRenderer to draw a line at every mouse click. As you can see, everytime the lines collides with itself it creates a new shape. I'm able ...
SilentRage47's user avatar
0 votes
1 answer
909 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 ...
blackhole's user avatar
0 votes
1 answer
424 views

Resize rigidbody in runtime, Box collider OnTriggerEnter not work

Scene setting: Object A: Rigidbody, kinmeatic Box collider, is trigger true. Object B: Box collider, is trigger true. Script is on Object A: ...
Shitman's user avatar