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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
23 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) ...
user avatar
0 votes
1 answer
39 views

Why doesn't MeshCollider work in a build?

I have MeshColliders in my scene that are shaped like an hourglass and it works perfectly fine in the editor. However, once I build on XCode and test on my iPhone, ...
user avatar
0 votes
0 answers
26 views

Unity's Collider.OverlapCollider is not consistent

I am making a 2D level editor and when I am placing a sprite over another collider it should prevent me from being able to place the item. When the collider being placed is completely over an item it'...
user avatar
0 votes
1 answer
45 views

Where did the Composite Collider go?

Some of my GameObjects have 2 Sprites nested under them, like how Cat and Snake are nested under Sprites: The "Cat + Snake" parent GameObject has a Composite Collider 2D and a RigidBody 2D ...
user avatar
  • 163
0 votes
0 answers
16 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 ...
user avatar
  • 163
0 votes
1 answer
44 views

Possible to have Composite Collider 2D detect colliders in grandchildren?

I have a number of GameObjects with 2 child GameObjects: Sprite Words There is a a BoxCollider2D on both the Sprite child and the Words child. The parent has a Composite Collider 2D on it, which ...
user avatar
  • 163
0 votes
0 answers
14 views

Collision: Simplify Multiple UCX Objects

Unreal Engine 4/5 Is it absolutely necessary to create multiple UCX collision objects in my 3D program? I have a very small, simple room for the player to walk around in yet I have to create 18 ...
user avatar
  • 111
0 votes
1 answer
40 views

I have a "Floating Capsule Collider" setup, but if Collider stands on the edge of a platform, the player Mesh ends up looking 'stuck'

I have a "Floating Capsule Collider" setup, but it has an issue when the Collider stands on the very edge of a platform-- the player Mesh ends up looking 'stuck' inside of the platform. How ...
user avatar
  • 45
0 votes
0 answers
57 views

I'm using a *Floating* Capsule Collider, but it keeps contacting floor especially if I fall at high speeds?

I have the below code for a "Floating Capsule" style Rigidbody controller. Based largely on a tutorial (https://www.patreon.com/posts/astro-kat-moving-21343562) although I've modified it a ...
user avatar
  • 45
-1 votes
1 answer
27 views

How to destroy just the specific powerup I hit, not all of them?

Creating a game for a computer science class - basically I have a player (cop) who will collide with donuts. When the player collides with a Donut, I want the speed to increase by 0.5 each time. Here ...
user avatar
0 votes
1 answer
70 views

Godot KinematicBody2D Invisible After If Statement

The reason I address this question is because of the limited documentation and support for starting devs on Godot. I do not know what is wrong with this one if statement, but after I added it, my ...
user avatar
0 votes
1 answer
98 views

Why do colliders have a tendency to spin and develop crazy angular velocity in Unity when used as my "player"?

I am trying to create a basic collider for a rigidbody player in Unity 3D. I have been experimenting with numerous shapes but found it hard to get what I want. The primary issue seems to be if the ...
user avatar
  • 197
1 vote
1 answer
70 views

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

I have a simple object with a Rigidbody 2D and a Box Collider 2d, that's supposed to fall and land on a tilemap with a static <...
user avatar
0 votes
0 answers
45 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 ...
user avatar
1 vote
0 answers
149 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 ...
user avatar
  • 11
0 votes
1 answer
46 views

Unity how to make raycaster test only against collider in frustum

I'm working on a scene with thousands of object wich have all a collider associated. I'm just testing if my mouse is on top of any collider in a 2D space. The raycasting operation is taking a lot of ...
user avatar
0 votes
1 answer
37 views

My First Person Player Capsule Is Always About 6 inches Under The Floor

Here is the problem. This is the exterior of the hallway in which my player capsule is standing. Notice the bottom of the capsule poking through the floor. This is the interior of the hallway, notice ...
user avatar
0 votes
0 answers
109 views

How to display ray collision object with Ray Perception Sensor 3D Unity ML-Agents

I try to detect collisions with the Ray Perception Sensor 3D from Unity ML-Agents. I read that collisions with colliders through the rays will be automatically added to observations. How can I display ...
user avatar
0 votes
0 answers
41 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 ...
user avatar
0 votes
1 answer
40 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 ...
user avatar
0 votes
1 answer
27 views

How to make trigger function respond to certain collider pairs and not others?

I assigned two colliders to one GameObject. Both are different sizes. I am doing operations with Trigger messages. I want this Trigger function to work for only colliders 1 and 3, but not collider 2.
user avatar
  • 13
0 votes
3 answers
188 views

Why am I getting Null Reference Exception inspite of checking if the Object is not null to execute something

Hi I am just trying to convert a simple flappy bird game into multiplayer game. So In the multiplayer game using Photon , I want the bird to collide with the ground or pipe but not with the enemy bird ...
user avatar
0 votes
0 answers
32 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 ...
user avatar
0 votes
0 answers
20 views

How to make a swimmable body of water made out of particles?

I'm trying to make a swimmable body of water made entirely of hundreds of water particles. Previously I had a swimming system that was just box with tag 'Water' and a box collider with ...
user avatar
  • 45
0 votes
0 answers
23 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 ...
user avatar
  • 143
0 votes
1 answer
317 views

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

I am trying to get my enemy to take damage, however it is not working. I know the reason: the box colliders on not triggering the OnTriggerEnter message. I do not ...
user avatar
0 votes
1 answer
73 views

Why does OnTriggerEnter2D/OnCollisionEnter2D work when there is no other collider object opposite?

my bullet: There is a Box collider (checked "is Trigger") It has Rigidbody2D (Gravity = 0, freeze rotation Z) https://imgur.com/T4j1QoO I added the "OnTriggerEnter2D" function ...
user avatar
  • 13
2 votes
1 answer
51 views

Collision objects aren't preventing falling in Unity

This is a super basic question, but I have absolutelly no clue why there is no collision and the player continues to fall. Im following FreeCodeCamp(minute 37:20). This is what I have: What is ...
user avatar
  • 125
1 vote
1 answer
945 views

Show colliders in a build game in Unity

Is there a way to show all colliders 2D in a a released game at once? I am making a 2D game in Unity and have to show all colliders to the player. Can I use Gizmos?
user avatar
0 votes
0 answers
145 views

Unity: how to make a kinematic rigidbody react to a rigidbody hitting it?

How do I make a non-kinematic rigidbody react to a "normal" rigidbody colliding with it in Unity? Like when the rigidbody hits the non-kinematic one, it pushes it back (note: not using the ...
user avatar
0 votes
1 answer
25 views

how to add overall collider to a bunch of circles or boxes?

I have 3 circles (2D) they all have circleCollider2D. what I want is to make a collider that make border around them. I can't express which type of collider I need, so I put example image below. Red ...
user avatar
0 votes
1 answer
124 views

Automatically create capsule colliders from bones?

I have tried to automatically generate capsule colliders from bones by temporarily creating a mesh collider and using raycast to find the distance to it from the bone, but when I create the capsule ...
user avatar
  • 135
0 votes
1 answer
98 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 ...
user avatar
  • 13
1 vote
1 answer
272 views

Firearm magazine ejection

I am playing around with a VR game where the player can fire a hand gun. When the magazine is empty they can press a button on the controller to eject the magazine from the gun. As its VR, I would ...
user avatar
0 votes
2 answers
80 views

Detect what object was dropped onto, rather than the object being dragged

I want to make a simple drag and drop system in 2D in Unity. When the user drags the object to a position, I want to check if the position is valid. As in I want the user to drag an object onto ...
user avatar
  • 7
1 vote
0 answers
33 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 ...
user avatar
  • 123
0 votes
0 answers
67 views

HUGE 2D worlds in Unity (like spaceflight simulator)

I am a beginner in the field of game development and I am having some doubts regarding some stuff... I am trying to build a 2D space-rocket-orbit game like the Spaceflight Simulator and I'm not able ...
user avatar
0 votes
0 answers
201 views

How to use Transform.lossyScale in a local reference frame?

According to the Unity docs for Transform.lossyScale, this attribute is "The global scale of the object". From what I can tell, this isn't actually an estimate of the scaling aligned with ...
user avatar
  • 131
0 votes
0 answers
11 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. ...
user avatar
0 votes
1 answer
609 views

Scope of 'this' - Cannot read property of undefined in collider and overlap function

I am working on my first 2D game with Phaser 3. I have set up VS Code with a node.js https server and run it to deploy the game on localhost. While the game gets compiled successfully and deployed, I ...
user avatar
  • 11
1 vote
1 answer
103 views

How big can/should wall colliders be?

Following my previous question, I now have my wall collider building tool and built many of them: Bird-view, about 17 walls selected, on the right, one is selected: Here, wall and barriers form a ...
user avatar
  • 763
1 vote
1 answer
92 views

How could I simulate projectile collision agaisnt RTS units with primitive colliders?

For example, humans are easy they are just capsules. But for cavalry, an arrow could hit the horse or the rider. Right now cavalry are also capsule colliders for unit-unit collision, but for ...
user avatar
0 votes
1 answer
49 views

How to best apply colliders on a rough 3D shape

I have a 3D model for a level in unity. I want to add colliders to it. What is the best type of collider for this model? And,it is 3D
user avatar
  • 11
0 votes
2 answers
192 views

Rigidbody not working properly

I have two objects: a player and a wall. The player is passing through the long side of the wall but it collided with the short side of the wall. I want the player to collide with whole wall. Here is ...
user avatar
  • 11
0 votes
2 answers
136 views

Position of Gameobject Changes When Hit Play Button

I have a 3D Humanoid model. When I press play button, suddenly position of model changes and collider doesn't match with model.
user avatar
0 votes
2 answers
64 views

Coins are solid objects and I can't collect them

I am just starting out with Unity following along with this video, and I am stuck at roughly 1 hour and 54 minutes in: https://www.youtube.com/watch?v=pwZpJzpE2lQ It is worth noting that the video ...
user avatar
0 votes
1 answer
39 views

Is it possible to prevent the collider 2D outline from hiding in Unity?

Is it possible to prevent the collider 2D outline from hiding in Unity? I am creating some animations in Unity. To create animations I select different parts of a hero and move them frame by frame. ...
user avatar
0 votes
1 answer
38 views

Sphere - AABOX Edge detection

I am trying to implement a particle-AABOX edge collision, the below images represent, two timesteps(dt) where the spherical particle is accelerated by gravity. I have the particle center C and its ...
user avatar
  • 3
0 votes
1 answer
33 views

Applying velocity to parent that ignores children's mass not working

I am making a VR data visualisation app in Unity and I have a parent with many children (just some primitive cubes) that I can toss around the scene by just setting the parent's rigidbody to the same ...
user avatar
  • 101
1 vote
1 answer
604 views

Is it possible to somehow change the collider points to match sprites during the animation in Unity?

Is it possible to somehow change the collider points to match sprites during the animation in Unity? I am using the Unity built in animtion recording feature. I would like to change the points of some ...
user avatar