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
1answer
41 views

My polygons only register a collision if they are the same shape and directly over top of each other

I'm trying to learn about 2d polygon collision detection/handling and have ran into a snag. After running through lots of tutorials and sample code I've attempted to implement my own polygon class ...
1
vote
2answers
64 views

Area attack collision resolving

I'm planning to write little 2D go-right-and-swing-your-sword game. When i started to write my ideas on paper i've come across a little problem. Let's say i'm using magic spell, ex. fireball which ...
3
votes
1answer
56 views

Collision resolution when moving in two directions

I am making a bomberman clone and I'm having problems regarding moving on both x and y axis (pressing down+left, down+right, up+left). Here is a video to demonstrate the problem. I use Tiled for the ...
0
votes
0answers
29 views

collision detection with rotating Sprite

Im using Libgdx. I have a space ship sprite rotating around the earth trying to avoid incoming asteroids. The ship is being rotated by setting it's origin in the earths center. How do i detect ...
0
votes
1answer
57 views

Tile-based collision problem with corners

I am currently making a tile based collision system. But I encountered a big problem I can't seem to figure out. Use the image bellow for reference. Gray lines represent the border between tiles. ...
1
vote
0answers
24 views

Collision destroy a cube when player collides [closed]

Unity- I have a mesh named and tagged as player I want that when it touches a Cube it should get destroyed C# script I need ....ty
0
votes
2answers
75 views

Collision works except for when coming from right side

I am trying to make a bomberman clone. I'm having problems with the collision on the walls that is not on the sides of the map (see image). When I come from the right (going left), the red square ...
4
votes
1answer
85 views

How to solve Sweep and prune false positives concerning large floor plane

I am developing a 3d sweep and prune module for a project, and it is producing false positives. The pair generation code is as follows: for (unsigned int i = 0; i < mXExtents.size(); i +=2) ...
5
votes
1answer
150 views

How to detect collision only in non-transparent texture?

I am developing a game using libgdx. I am trying to detect the collision between bee and tube. I am using the following code to detect the collision. if(player.getBounds().overlaps(boundsBot)){ } ...
0
votes
1answer
64 views

AS3 .hitTestObject() not working with Tween function

(This was originally in an other senction but many told me to ask here, hopefully someone can answer this) I am having a major problem in my new browser app. Okay so I made game where different cubes ...
0
votes
1answer
91 views

2d raycast collision problem

I am currently making a 2d top down game in unity and have stumbled upon a problem with my raycast collision. I want my green player to stop moving when colliding with a wall, therefore i made my ...
0
votes
2answers
52 views

Cannot detect input in void OnCollisionEnter()

Code: void OnCollisionEnter() { if (Input.GetMouseButton(0)) { // do something } } Of course, this code does not work. What I intend to do: "After collision, if the ...
0
votes
1answer
91 views

Copy a gameObject's collider at runtime (Unity)

I'm working on a small Unity 2D project in which I need to modify the collider of the player at runtime. I'm using Physics2D.Raycast to find the collider and then what I'd like to be able to do is ...
-1
votes
1answer
67 views

XNA collision detection between Lists

I have 2 lists, one is for meteors and second is for bullets. I have problem with collision detection between them, this is my code for meteor spawning: public void LoadMeteors() { ...
0
votes
1answer
42 views

Mismatch between scene view and game view

In my scene view, it looks like the player is correctly lined up with the map. But when I see it in the game view, it's off. You can see the Game view in the top-middle, and the Scene view in the ...
0
votes
0answers
31 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
148 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
78 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
26 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
38 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
48 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
38 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
53 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
44 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
66 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
50 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 ...
-15
votes
1answer
390 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
124 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
93 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
43 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
75 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
110 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
75 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
29 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
58 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
2answers
163 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
134 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
65 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
98 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
150 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
93 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
56 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
47 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
57 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
189 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
59 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
38 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 ...
-5
votes
2answers
176 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
34 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, ...