Collision detection is the determination of whether or not two or more entities make contact with each other during gameplay.

learn more… | top users | synonyms (2)

0
votes
0answers
27 views

Circle velocities stay the same after elastic 2D collision

I am following this paper in trying to create elastic 2D collisions among two circles. The problem is that my end velocities are the same as my start velocities. I've looked over my code and don't see ...
0
votes
2answers
100 views

OnTriggerEnter() without rigidbody?

I know this is an old question and it has been answered for a lot of people. Unfortunately none of the solutions apply to the problem I seem to have with rigidbodies. I have a moving AI character and ...
3
votes
1answer
62 views

Mesh-level acceleration structures for collision detection when mesh instances can be rotated, scaled and/or resized

Short version: in the mid-phase or narrow-phase of collision-detection, does any acceleration structure organizing the mesh's vertices (e.g. AABB-trees, Octrees, Quadtrees) work for the mesh's ...
0
votes
0answers
23 views

Java Rectangle Collision Glitch

I have a platformer type game where I have a level builder(reads a .png file and converts into a level where there are rectangle boxes). I have rectangle collision on the boxes but when I make my ...
0
votes
0answers
35 views

Problem with Collision Detection

So I am adding collision detection into my game but whenever I start the game I get a rendering crash saying that there is a 'Game.update() failure - check the game code.' I have repeatedly tried to ...
1
vote
0answers
35 views

Implementing Separating Axis Theorem in 3D with C++/OpenGL

Using an Octree data structure provided to me by an acquaintance that gives min/max bounding box values, I've been able to write an algorithm that takes the global centre points, face normals and half ...
0
votes
1answer
34 views

Why is my counter not incrementing when OnTriggerEnter is called?

I have a script that handles the destruction of game objects based on what they collide with. I am trying to count the number of objects destroyed when they collide with specific objects. However, ...
-1
votes
1answer
51 views

collsion detection [closed]

I am making a 2D bubble shooter game but m stuck on a point. I have printed those balls in a 2D space using 2D arrays. Each row has 3 inputs one is x coordinate,one is y coordinate and one is the ...
-1
votes
1answer
37 views

LibGDX - Map Boundaries

Synopsis Well, I'm making a little top-down JRPG and today I was like 'Yeah, I'm gonna bust out this whole map collision thing!'. I failed. Problem So I went on the internet and looked up 'LibGDX ...
0
votes
2answers
44 views

Delaying certain actions/functions in libgdx using Timer?

Hello I am trying to delay a part of the processes in my game, but it happend that I use one of my variables in an inner class so I have to make it final, but by making it final I can't assign new ...
0
votes
1answer
37 views

Storing color and position (height and width) in an array which can be changed accordingly (bubble shooter)

How can I store the colors and position (i.e the position of the balls in bubble shooter game) using an array? I first tried using a simple loop but I think it won't work when I need the balls to ...
-14
votes
1answer
349 views

How can I “squeeze” a game object when it is pressed between two others?

I am trying to "squeeze" a game object when it's pressed between two other objects (e.g., "squeezer 1" and "squeezer 2," below) that continue to move towards eachother. I wish to reduce width of the ...
3
votes
1answer
87 views

Resolving collisions with float precision errors

I'm facing a problem when I try to resolve the collision between two units using floats as positions of the units in my game. I am detecting the collisions using the SweptAABB algorithm and if there ...
0
votes
1answer
52 views

OnCollisionEnter is called over and over again

Currently I'm trying to let the player place a GameObject in the world. You can imagine this like a RTS game where you can place a building you have just build. My problem now is, in order to avoid ...
2
votes
1answer
31 views

Call function via ContactListener

I've been creating a game on my own in LIBGDX, BOX2D and there' s a problem I can' t solve. When two World bodies collide, method "beginContact" is called in MyContactListener class that implements ...
2
votes
0answers
59 views

How to detect collisions with a material in Unity 5?

I've got a simple car game with 3 different surfaces: grass, tar and sand. I have a basic skid smoke system, but I want the color of the skid smoke to change depending on the surface, for example on ...
2
votes
1answer
66 views

Simple 3D OBB-Collision (DirectX9, C++)

I'm trying to implement a simple OBB vs. OBB collision detection! I don't need to know where the collision occures, I only want to know whether a collision occures. The problem is, that after lot of ...
0
votes
1answer
66 views

Collision problem with multiple tiles (rectangles)

I think that I found what the problem is, see below So I'm working on a collision system and I use multiple tiles in my project, each with a collision box. The player also has a collision box. I'm ...
0
votes
0answers
24 views

Touch and Collisions not working together in AndEngine when i set a custom Physics Handler

I have a set of custom sprites which implement a custom physics handler. The aim is to allow the user to move them by touch, then upon release they should act like a spring is connecting them to the ...
3
votes
0answers
44 views

Check if a point is touching a user drawn curve in HTML5 canvas

I am having trouble detecting whether a ball is colliding with a red curve. The curve below is an example of what a user may draw on to the canvas. I can't think of any fast ways to detect collision ...
4
votes
1answer
107 views

Can I use two Collision Boxes on the same GameObject?

I have two Collision Boxes on the same GameObject. I don't want the Collision Boxes to be triggers. I want the Collision Boxes on the actual GameObject, not its children. For example, if I want to ...
5
votes
2answers
90 views

Is there an equivalent of Unity's OnCollisionEnter() in UE4?

I've been looking for how to figure out when two objects are colliding all day. If anyone knows how to do it I would be grateful. What I really want is a similar function to Unity's ...
3
votes
2answers
61 views

Problem with trigger

I am making a melee attack with my game, but I'm stuck in a problem related to using triggers. The enemy NPCs have a sphere collider set on trigger so I will know who is inside their range (radius of ...
1
vote
1answer
63 views

How to remove destroyed clones out of the Hierarchy in Unity2D

I made a 2D edge collider which on contact destroys the other gameobject. When I launch the game all the other gameobjects in fact get destroyed but the clones are still listed in the Hierarchy. How ...
3
votes
2answers
72 views

How do I induce collision events in LibGDX 3D?

In the code below I've put an example of something I want to do. I have the camera and I want it to stop moving whenever it hits one of the boxes, how do I do this? public class Main extends ...
2
votes
1answer
64 views

Two 2D objects in Unity aren't colliding together

In Unity 5, I have a player shooting a projectile in aim to hit a boss, and inflict damage upon contact with the projectile. Though for some reason, the projectile and boss aren't colliding with each ...
0
votes
1answer
53 views

Java 2d topdown collision

Im making a game and Im working on the collision. First Ill tell you what I want (Ill put in pictures), then Ill leave the code. What I want: I want the player to stop exactly before its collision ...
1
vote
1answer
43 views

Javascript canvas check if all recs on the screen overlap a new one

So I know the AABB collision detection formula, however, this code does not work. Whenever I press space, a new square pops up. But this new square can spawn inside another, something that I do not ...
2
votes
1answer
50 views

Multiple overlapping rectangles

I have a collision method where the parameters for the method are the rectangle of the player and a list with the rectangles of the tiles. I work with booleans like bLeft, bRight,... and this ...
1
vote
2answers
85 views

Libgdx: If Rectangle overlaps anything?

I've written a code that allows me to talk with an NPC. This works as long as there is only 1 NPC on the map. I'll explain why. public void getNPCCollision(){ for (int i = players.size() - 1; i ...
1
vote
0answers
56 views

Game is responding very slowly?

I have a very simple app which removes buttons and re-adds buttons to certain layouts when a button is clicked. The problem is, this process is taking a very long time. My question is: How can I make ...
1
vote
0answers
32 views

How can I move my button?

I am new to animations in android. I was wondering, is there a way to keep a button moving around the screen, bouncing off the walls, until it gets clicked? I was thinking to do something like this: ...
2
votes
1answer
33 views

Collision method only using one item from list

I've made a temporarily method for collision with all the blocks on the screen. (I used almost the same method in the past, but only for one block at the time.) So I start in the Sprite class. I use ...
-4
votes
2answers
107 views

Unity Renderer.bounds issue?

I would like to make rend.bounds.max.y be always equal to 20 on collision no matter what, using the script below. But it seems that I can't set it manually and the script has no effect on my ...
0
votes
1answer
30 views

2d Tile Based Collision Response

Right now I am trying to make a 2d collision response system for a platformer, and the algorithm I have for it works quite well. The only problem is that if the player is standing exactly on a tile, ...
0
votes
1answer
47 views

XNA Platformer - Where should tile collision handling be?

I've started using XNA and am working on a simple 2D platformer (single level). However, I am stuck as to where the collision detection should be handled. Here is my current project structure: The ...
0
votes
1answer
29 views

Activate and Deactivate Collider with Click

i'm having some troubles working with this, it's basically a Sword that points towards your mouse position, and when you Left-Click, a Trigger Collider is activated and then deactivated, but i can't ...
0
votes
1answer
42 views

How to avoid mouse click over the trigger object?

I'm detecting the mouse clicks if the click is happened over the collider but i dont't want to fire mouse click if it is on the trigger object. How to i do this. Anyone give me a suggestion. Thank ...
3
votes
1answer
73 views

Get collision time between two moving, non uniform Axis Aligned bounding boxes

I have a problem finding the exact time of collision of two possibly moving or static objects. Both objects have AABB data (HalfExtents, Min, Max, Center vector and stuff) and a velocity vector. The ...
3
votes
1answer
144 views

Attach to a GameObject after collision? [duplicate]

How can I make a GameObject attach (or "stick") to another GameObject after collision? The problem: I want the GameObject to attach after collision even if it changes scale. What I have tried: ...
0
votes
1answer
45 views

Collisions between mesh (bounding-box) and Vertex/Index Buffer

I have a short Question: I'm trying to add Collisions in my 3D DirectX9 game and my World is Stored in a LPDIRECT3DVERTEXBUFFER9 and LPDIRECT3DINDEXBUFFER9 and Rendered per DrawIndexedPrimitive. My ...
0
votes
0answers
49 views

Endless sidescrolling skating spritekit game

I am developing an endless side scrolling game in spritekit. For parallax background scroll : - (void) update:(NSTimeInterval)currentTime { [self.children enumerateObjectsUsingBlock:^(SKNode * ...
3
votes
2answers
54 views

multiple contacts for SAT collision detection

I have implemented SAT algorithm for obb-obb intersection and I am able to generate a contact for this collision type. My problem is that SAT only generate ONE contact and in many situation I need ...
3
votes
1answer
90 views

Separating Axis Theorem - Calculate Normals from Points in 3D

So while researching for a method to detect collisions in a 3D space between (arbitrary rotated) boxes, I stumbled upon this excellent question with great resources for my further research and great ...
5
votes
1answer
124 views

Finding new position after collision with multiple colliders

What is the most accurate way to find the correct position to where a moving character should be re-positioned as a collision-resolution, after it has collided with multiple colliders? The figure ...
1
vote
2answers
96 views

How to make your own 2D AABB collision system in unity?

I can't use the built in unity 2d physics engine for my game, so I tried to make my own using the unity bounds.Intersects, that is working perfectly but my problem is that I don't know how to make the ...
1
vote
1answer
68 views

Libgdx: Check collisions in Stage among actors

My goal is to check collisions among the actors that are in the Stage. My question is: is it necessary to maintain a list for each type of actor I have? Doing that I get 3 problems, 2 bad design ...
2
votes
1answer
67 views

Jumping onto higher ground Collider issues

What's the general solution to the following character animation problem (I'm using Unity)? You have a character with a capsule collider and a jump animation that allows you to jump onto higher ...
1
vote
1answer
89 views

Two dimensional elastic collision of balls

I am trying to create a simple elastic collision simulation in java. (I am using some helper libs like StdRandom) Here is my Ball class : class Ball { double cx, cy; Vector velocity; ...
1
vote
2answers
89 views

Collision between complex polyominoes travelling at different velocities

My first post here if there's anything wrong please do highlight it :) First and foremost the problem I'm facing is practically identical to this earlier post here : Falling Blocks and complex shapes ...