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)

1
vote
1answer
235 views

How to detect collision position and that position's texture color in Unity?

I have a prefab and I use Circlecollider2D for physics operations. I want to detect the color of the contact position of the collided objects ? Is is possible by using Unity's collider classes ?
0
votes
1answer
10 views

XNA/MonoGame Collisions between two boxes don't work as expected

I have the following problem: I have two GameObjects (one is static, the other is the player). Both of them have one BoundingBox that surrounds them, and a List that contains more BoundingBoxes for a ...
0
votes
0answers
4 views

Collision event callback on p2js not working

So, I'm making a simple game on Phaser where a ball object and bullet group collide with each other, incrementing a score variable whenever this happens. I already set up the collision groups and are ...
6
votes
1answer
159 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
213 views

Collision between a sphere and a mesh(height-map)

I am trying to implement a method that detects the collision between a sphere and a mesh and reflects the vector of speed. I have a method, that detects a collision between a sphere and a triangle and ...
3
votes
2answers
1k views

How do I deal with abstracting collision handling code between entities with differing collision components?

I'm using a component based entity design with Components that hold the data and Systems that act on entities based on the components they have. Entities are registered to all systems as they are ...
2
votes
1answer
102 views

Could triangles be used for swept-AABB checks between positions?

I'm trying to understand swept-AABB collision detection. When checking for collisions between two positions of an object, I commonly see one of 3 strategies used: Rays: trace rays from parts of the ...
2
votes
4answers
220 views

How to make sure that when two bodies collide, there is only one collision detection on box2d?

I'm using LibGDX with Box2D and, when two bodies collide, the collision is detected multiple times. Here's the code: public void preSolve(Contact contact, Manifold oldManifold) { Body a = ...
14
votes
4answers
4k views

Is it a bad idea to “map” the mouse position on the screen so that collision detection works regardless of resolution?

Consider a game who's default resolution is 800x600. Objects with collision masks are placed in a game world of size 800x600. The collision masks can detect when the mouse collides with them. Now ...
0
votes
4answers
126 views

How to do one-way collision?

I would like to know how can I do one way collision. It's the collision common in mario's games and many platforms. I try to do an code but I cannot post because it's part of a paid game. Basically I ...
1
vote
1answer
109 views

My “puck” model object falls right through the “table” model in jMonkeyEngine

So I am trying to learn jMonkey, I have understood everything so far, and I thought I understood how to make objects solid, so things can't go through each other. When I create my Collision shapes, I ...
0
votes
4answers
82 views

How do I trigger just once and not multiple times if I the Player enters the Trigger? [duplicate]

I wanna trigger just one time and not multiple times. I have a Health System and I want that the Player takes damage from an GameObject if he enters the Trigger but it directly triggers like 65 times ...
0
votes
2answers
611 views

Basic 2d platform collision detection algorithm has a slight bug (Java)

I'm trying to implement collision detection between Player (the main character) and a Platform. They are both modelled as rectangles; when player hits the side of a platform he should bounce off it ...
0
votes
1answer
66 views

How to use collision masks and overlap_area in pygame?

So, I've been prototyping a game, and I've been using sprite collision, and it's not cutting it any more. I read up on the documentation about masks and overlap area: ...
0
votes
1answer
18 views

Bullet: Apply any Transformation to RigidBody?

I'm using Bullet for CollisionDetection. I load a scene from a Collada-File using Assimp. Let's say I want to give every object in the scene a RigidBody with a box as CollisionShape. Right now I first ...
1
vote
1answer
277 views

Collision detection doesn't register until player sprite jumps

I have implemented a shooting mechanic into my game, and the act of shooting works fine. The shooting work is done in my "game1" class. The issue that arises is when I incorporate collision detection ...
0
votes
1answer
610 views

How do you set multiple collision rules with Swift and SpriteKit?

So basically I've got 2 types of balls and 2 types of enemies. Green can delete red only, red can hit delete only. Here's what I have for the first collision test: func didBeginContact(contact: ...
0
votes
1answer
223 views

AABB Collision Problems in SFML

I have a problem with AABB collision. I am making a top down rougelike in SFML and my collision algorithm does't quite work properly. HERE IS A GIF OF THE PROBLEM. It mostly works, except for when ...
0
votes
0answers
52 views

Weird Collisions in ODE

I'm trying to get a basic OBB/OBB Collision System working. For this I use ODE. My problem is: Whenever I use the dSpaceCollide and pass in my Space and my Callback, my Callback shows me, that a ...
0
votes
1answer
20 views

Collision causing FPC to go haywire

I have created a first person controller as an enemy in my game (Zombie), my character is an Archer using Arrows as projectiles fired using: if(Input.GetButton("Fire1")) { shotForce += ...
0
votes
0answers
12 views

Check collision between List of bullets and List of characters XNA [closed]

I have a problem with collision between List of bullets and List of characters. My hero class that run on all bullets in List of bullets. foreach (Bullet bullet in S.bullets) { ...
1
vote
1answer
76 views

How to calculate distance of travel needed get achieve speed x?

I have a boat traveling at 20 meters/second approaching destination x. Destination x has a range radius of 10 meters. What I would like to do is make sure by the time the boat arrives within 10 meters ...
3
votes
1answer
266 views

Determine wheter an octree node needs to be continue

For collision detection (moving vs. non-moving) in my current project, I decided to implement an octree approach after the preselection. The only collision detection I'm currently using is a ...
1
vote
0answers
36 views

Swept AABB vs AABB Calculation Error

I'm having issues running simple AABB vs AABB collision detection. I'm able to successfully detect collisions without checking with velocity. But for some reason my code keeps prematurely firing ...
2
votes
2answers
163 views

2D Collision at corners using C# - without xna or unity

I'm trying to make collision for a 2D game, the player (car) has to collide with the walls of the track when it hits them. I looked into pixel color detection, and X,Y -based collision (But since its ...
0
votes
1answer
286 views

Swift - How do I detect the exact point at which two “SKPhysicsBody(edgeFromPoint:” type physics bodies intersect in sprite kit

I have two physics bodies attached to two separate sprite nodes using Sprit Kit. One is a vertical line and one is a horizontal line: //sprite with horizontal physics body ...
0
votes
1answer
67 views

Bullet: No Bouncing off the walls

I'm using Bullet Physics for Collision Detection in a first person game. The collision basically work fine, I cannot walk through objects. But if I walk against the wall and release the key I get ...
0
votes
1answer
31 views

In 2d, how do I discern when a character is on top of an object, from when it is on the side?

I am building an auto-run platforming game. I have code so that if the character collides with a wall, they are pushed back until they are able to get past the wall. Unfortunately, this means that ...
0
votes
1answer
63 views

Issue with detecting collisions in Pong

I've been working on making Pong in OpenGL and SDL and currently have both paddles and the game ball set up properly. I have an Object (or Entity) class which is used to instantiate each of the ...
2
votes
3answers
326 views

Adding a small slide when player releases left/right key

The aim is for the player object to slow down and stop instead of just stopping dead. The following codes works ok when the player is not jumping, but gets stuck in an object if the player is in the ...
2
votes
1answer
140 views

Detect walking on floor - works partially

I have a set of Gameobject blocks that form a floor with Box Collider and a GameObject with a Box Collider in it. My first hunch detecting hitting the floor was: void OnCollisionEnter2D(Collision2D ...
0
votes
1answer
62 views

How do I make my enemies to follow a path and allow them to collide with the player in Game Maker?

I am making a game in which enemies follow a path. These enemies should be colliding with the player, but it's not working. The enemy is walking the path. And, I want to make it so if the player ...
1
vote
1answer
21 views

Convert Triangle/OBB Test to OBB/OBB Test

I'm using the collision library OZCollide (http://www.tsarevitch.org/ozcollide/) and I want to do OBB vs. OBB collision tests. The problem is, that this function doesn't seem to exist (see my other ...
0
votes
1answer
119 views

Where should I save game object's attributes (hp, score) in Swift?

Scenario: I have a game with several game objects on screen. Each can have different score and hitpoints. When I use collision detection for cannonball vs. ship (example) I need to know which ship is ...
1
vote
1answer
74 views

Detecting Collision in Next Step when Collider is rotating

In my Gamemaker: Studio game, I have a collision script for my enemy. The enemy is an alien, oSwarmer, moving through space which is also filled with drifting, spinning bits of debris. Some debris ...
3
votes
3answers
352 views

Fastest 3D bounding box algorithm

I am at the point in my game where I need to add a collision system. I tried jBullet, and while it did work, it wasn't what I was looking for. I just want a simple way to test if two oriented bounding ...
0
votes
1answer
634 views

Game object position issue in unity3d

I have a set of objects placed on the same layer where all the objects are invisible except one. When I drag an object into a selected area, the current dragged object gets destroyed, and the object ...
0
votes
1answer
65 views

Frustum culling takes ages c++

I have two ways of doing frustum culling taken from different web sources. First one takes 200ms to check 10k AABBs, second around 50ms for the same box count. I read some forum answers, people say ...
1
vote
1answer
220 views

LibGDX - Tilemap Wall Collision Detection Issues

I cribbed some code from another web tutorial (SuperKoalio - https://github.com/libgdx/libgdx/blob/master/tests/gdx-tests/src/com/badlogic/gdx/tests/superkoalio/SuperKoalio.java) about detecting a ...
0
votes
0answers
22 views

OBB/OBB Test in OZCollide

I want to know if anybody, who tried OZCollide (http://www.tsarevitch.org/ozcollide/), knows whether OBB vs. OBB Tests are possible or not. I know there is a AABB vs. OBB function but I can't find one ...
0
votes
1answer
35 views

Player collision with object

so I have an fps controller, and I want to change camera when it collides with a box collider. I think I did it properly but it didn't work. Here's my code. using UnityEngine; using ...
0
votes
0answers
45 views

Side-Collision for Breakout game where ball moves fast

So I've been trying to make a breakout clone, which is my first attempt at a graphical game, I ran into some problems, and was hoping that this community could help me. I've got most of the mechanics ...
0
votes
1answer
64 views

How to handle collision detection

So the way that I am doing the movement for my game is that you can left click a unit (which is just a rectangle object), and then it is selected. While it is selected, you can right click and that ...
4
votes
1answer
56 views

How do I create a custom collision map for clickable areas on a map?

Say I had a map like the one displayed above. What would be the best method of creating a collision map for each individual state where I can click individually?
0
votes
0answers
22 views

OBB Collision Intersection Problem

I'm trying to create OBB's around objects and then collide them using DirectX 11 and C++. It all works fine until I rotate one (or more) of the boxes and then the collision detection returns true too ...
1
vote
1answer
39 views

Collision Detection Unresponsiveness

I'm creating a simple jumper game in Libgdx that makes the player jump over obstacles in order to stay alive. The only problem is that the collision detection for when the player just touches the ...
-1
votes
2answers
43 views

How to pass the snake to pass through one side of the screen and come out the opposite side in c# game?? Help me :(

How do I code the left and right collision, and also tell me how I can set the collision of snake according to the form size. If i want to change or maximize the form, snake should collide with the ...
0
votes
1answer
20 views

Canvas/Paint Mechanic

I am currently working on an idea for a unity game app with a canvas mechanic. I understand I may have to use particles for the brush/paint f/x however I can not think of a way to add collision ...
0
votes
3answers
2k views

Find closest point on NavMesh if current target unreachable

I have a mock environment set up with a cube that has a specified "Not Walkable" layer. I'm using NavMeshAgent and NavMeshPath to set destinations of the player. The way I'm setting paths is by ...
0
votes
0answers
22 views

libgdx - Math reflection to the correct direction

I'm using a simple reflection system, but the game doesn't work how I want. How should this game work? The game has two boxes. A red side and a black side. The player should only sort the bombs to ...