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
14 views

Swept aabb collision resolution with multiple aabbs

I have followed this tutorial with a few tweaks to work for my engine. My code will only work with one AABB in my list of aabbs any more and it ceases to function properly. void Player::compute(...
2
votes
1answer
39 views

Separating axes theorem problem

I´ve been following this tutorial : http://www.dyn4j.org/2010/01/sat/ to help me understand and implement the SAT for collision detection in my games as I want to add a support for polygons. However, ...
-1
votes
0answers
23 views

How to do collision detection/response in 3d with aabbs?

I have found many tutorials for 2D but they do not translate well into 3D. I work only with aabbs and I need a "swept" response. This means it must work with
0
votes
0answers
22 views

Sweep Test not working at all

I have followed this guide to implement swept collision detection and response, but my game prototype doesn't respond to collisions at all. Here is my Code for the move method that takes the body ...
-1
votes
0answers
25 views

Multiplayer collision need help! [on hold]

I have been programming this 2d multiplayer fight game for a couple of days and I have animations for the main attack which is a hit/slash sorta thing. What I am trying to do is when the player ...
1
vote
1answer
43 views

Determine the bullet / particle reflection off of a circle in node js using SAT lib functions

I can see how the calculation should occur from other examples such as: How to bounce a 2d point particle off of a circular edge. But I could use some help with the specifics for my inputs given ...
0
votes
1answer
49 views

How to move from A to B, with check and fix the destiny?

I only found the formula for check the collision between two lines. But never about of movement and fixed from one point to other point in one of the line. I need move from pA to pB and if take ...
0
votes
0answers
24 views

Jump does not work when I change BoxCollider size

Following this tutorial I made a controllable character. Now I use a model and the jumping part of the code only works with the unchanged box collider (that is smaller than the model so it half way ...
0
votes
1answer
24 views

Polygon trigger colliders for 2D platformer

I'm creating a 2D platformer in MonoGame and I'm thinking of using AABB as physical colliders for characters and then have a trigger polygon collider on each character for checking for example if an ...
1
vote
1answer
29 views

How to setup different weapon colliders for multiple weapons in Unity2D?

I want to design a Metroidvania style game that uses different primary weapons, having very different hitboxes. I understand that many devs simply hardcode a collider in front of the character, but ...
0
votes
1answer
74 views

2D Collision Detection Problem

while making my game called "Journeys of Nemo the Fish" i stumbled upon a collision detection problem. Please, help me to solve it. The problem is: the program runs only the first if statement ...
0
votes
0answers
19 views

Android Studio Collision Detection

I have a circle that I move with an onTouch and a static rectangle. I want to identify when the circle hits the rectangle but I can't do it. Could someone guide me on the subject of collisions? Class ...
0
votes
1answer
20 views

2D stop on collision. XNA

So, this is the code I have right now. if (keysPressed.Count() > 0) { switch (keysPressed[0]) { case Keys.W: { ...
0
votes
0answers
26 views

Write a 3d collision object to binary file

If you were doing own file format, how would you store 3d collision data in binary file? I am decoding a binary file format and I don't understand the block of data. A little description how it is ...
0
votes
0answers
27 views

Collision for objects in Game Maker

In the game you can suck debris of the ground and I wanted that the objects collided with the walls. I put it in a script so I could use it in different objects. var ww, hh; ww = sprite_get_bbox_left(...
2
votes
3answers
40 views

OnTriggerEnter doesn't detect collision until at least one of the two colliders move

I'm having trouble coding a melee attack script. I've set up an attack hitbox that toggles enabled/disabled whenever you press a button (The hitbox itself doesn't move, it just blinks in and out) ...
0
votes
0answers
19 views

How do I use barycentric coordinates to determine the face-face collision, and set the collision point to the center of that face, accordingly?

I have a GJK EPA implementation that works perfectly with point-face collisions, however; when two faces collide (i.e. a box falls perfectly flat on a plane), the collision is registered at one of the ...
0
votes
1answer
29 views

Bounce once on a collision

I have BoxCollider2D and EdgeCollider2D how can I make the BoxCollider2D bounce only from the EdgeCollider2D and only once?
-1
votes
0answers
37 views

Collision between circle and rectangle

I have a circle that I move with an onTouch and a static rectangle. I want to identify when the circle hits the rectangle but I can't do it. Could someone guide me on the subject of collisions? Class ...
0
votes
0answers
19 views

How to see the size of an OverlapBox of the gameobject?

I have trouble detecting the colliders using the OverlapBox. I did drew a gizmos for it but how matter big the gizmos and the collider is, it still can't detect the colliders properly. The only thing ...
0
votes
0answers
22 views

PlayMaker hit terrain ground

So i feel like i have tried everything i have the following FSM: The distance check looks like this: AS you can see I've attempted with both a trigger event, a RayCast and a Collision event however ...
3
votes
1answer
72 views

Collision not working in phaser node multiplayer

I'm writing a tank trouble clone just for fun using phaser and node, so this is my tank instantiation tank = game.add.sprite(Math.random() * 800, Math.random() * 640, 'tank'); tank.anchor....
3
votes
2answers
79 views

Collison detection trouble. (c++ SDL2)

I have a small trouble with my collsion detection system, ill show it on images. im checking the detection by using that logic with example when moving to the right: obj.x+obj.w+obj.mov > block.x ...
0
votes
0answers
25 views

Assistance with bomb throwing mechanics akin to Zelda 2D

Does anyone have a good algorithm for managing the carrying and throwing of bombs? I've attempted to find a tutorial and can't find anything that covers the subject matter. I'm just looking for a very ...
0
votes
0answers
23 views

Fetching Wrong Transformation Matrix From JBullet Object

I am trying to render some boxes with shaders those physics calculations done by jbullet physics engine. I implemented overall jbullet world. But i cannot properly fetch transformation matrix from ...
0
votes
1answer
58 views

How can I find the position of a corner of a transformed sprite in SFML?

I need help with calculating the end points of a stick (a sprite) in my stick game. First, I set up it's position by some coordinate (x,y) after that I rotate it by theta degrees. I know the width ...
5
votes
3answers
193 views

How exactly do slopes and edges work in this scenario?

So this sort of behaviour probably exists in other games, but the old Kirby games - Kirby's Adventure and Kirby's Dreamland 2 - is where I noticed it. So, when dealing with regular block platforms, ...
0
votes
1answer
46 views

How do I make game objects move towards the player, when the player is within a set range?

I am trying to make game objects, like a coin or ammo clip, gravitate towards the player when they are within a set radius. I have seen this implemented in quite a few old school 90's games; when the ...
0
votes
1answer
75 views

Calculate the reflection of Ball [duplicate]

I have a collision in my game (see below) and a ball which is moving in a certainly speed to a random angle (x, y). My problem is. If it touches the collision it should reflect. I simply multiply ...
0
votes
1answer
51 views

Polygon-Circle Collision Algorithm not working

EDIT: Updated code and video I've been working on one of the last pieces of my collision detection system for my game, a polygon-circle collision method. I'm almost there with it, but there's a few ...
0
votes
2answers
171 views

2D racetrack collision bounce using angle of reflection (bounce angle)

I am currently working on a race game where I want to define the collision of my vehicle with the outer and inner borders of the track. If that happens to be the case I want to vehicle to bounce of ...
2
votes
1answer
55 views

Collision detection for an arc of a circle [closed]

So how do I implement the collision detection for an arc of a circle? Will I have to use the Box 2D collision or can I do it some other way using Rectangle or stuff like that? BTW I hate box2d ...
0
votes
1answer
51 views

Java - simultaneous ground and wall collision

I've been working on a Line2D based collision system: public void update() { for (int i = 0; i < lines.size(); i++) { line = lines.get(i); if (line.line.intersects(player....
1
vote
1answer
52 views

AABB 2D Collision response teleports player when hit on wrong edge

I'm currently breaking my head with collision detection and resolving in C++ for my 3D game engine. But currently I'm trying to get resolving to work in 2D. The problem is that when I hit the solid ...
0
votes
0answers
37 views

Problem with rectangle collision

I got a problem with collision detection - I thought it will be quite easy to fix, but apparently I was totally wrong. I wanted my player to hit a square object - if it will it from top, bottom, right ...
0
votes
0answers
51 views

Sphere to cylinder/line collision opengl

I currently have a sphere which I am trying to detect a collision with a cylinder. The following is the where the cylinder has been placed: mCyclinder151 = Matrix4.CreateScale(0.15f, 0.5f, 0.15f) * ...
0
votes
1answer
81 views

Unity, how to detect landing after jump?

How do I detect the landing of the player without getting interrupt by the onGround check ? I got 2 scripts, one is the normal player script and the other is what I was trying. in the onGround Script ...
0
votes
3answers
38 views

Find which collider is causing collision (implementing danger zone)

I have multiple SphereColliders attached to GameObject, one bigger to detect collision danger zone and the other, smaller, for actual collision (both triggers!). When the OnTriggerEnter() how do I ...
1
vote
2answers
44 views

Game (Physics) work in Unity Editor/Remote but won't on Android?

I have a script attached to a car game object that allows the player to tap the screen and then accelerate, the game object has a RB2D and collider set to it , it works fine in Unity Remote , but when ...
0
votes
1answer
55 views

Problem in bounding box collision detection in libGDX

I have a Background class containing 5 layers, I've created a collision box for 5th layer. Here is the code for my Background class: package com.gitlab.runner.tiger; import com.badlogic.gdx.Game; ...
0
votes
1answer
36 views

Collision Detection in Pygame

I'm making a game where the main character is a cat and has to avoid dogs and eat food. The collision detection works for the dogs and will subtract a bar of health from the cat, but when the cat ...
3
votes
2answers
82 views

Collider / coroutine timer issues

Now this may be a physics issue as it seems more of a collider issue - specifically using multiple box colliders inside 1 empty gameobject. Oh and aplogies about the lengthy thread. My game (for my ...
2
votes
1answer
42 views

Collision detection with Java streams and access of collisionable objects

I'm trying to learn some things about collision detection, and I've never known how to cleanly detect this for multiple objects in multiple classes without just copy pasting a lot of code. I now came ...
2
votes
1answer
35 views

Rigid body falls through static mesh even though collision is detected

I'm using Jitter Physics to create a game. For testing, I have ball (a spherical rigid body) falling onto a small box-like mesh. The problem is that the ball falls straight through the floor, even ...
0
votes
1answer
24 views

How to bounce the ball off a collider and destroying it using trigger?

I am making a Breakout game. I have bricks with box colliders and the ball is a rigidbody2d with circular collider. I have applied the PhysicsMaterial2D on the ball with bounciness set to 1 so the ...
0
votes
1answer
38 views

How to get a 2D vectorial terrain from an image for Java collision detection?

I'm trying to make a 2D Java-only game with a terrain like the one shown below. In the previous games I made, I used tile based collsions, but now, I want to use vector based collsions, as an uneven ...
1
vote
1answer
27 views

Using max for entry time in swept collision

I was reading this tutorial on swept AABB collision detection, and I was confused by this piece of code: // find the earliest/latest times of collision float entryTime = std::max(xEntry, yEntry); ...
0
votes
1answer
32 views

2D narrow-phase line intersection with square bounding box for calculating height efficiently

I've performed partitioning of my level into broad and narrow phase. I'm down to narrow phase and focusing on the height from the ground. I want to see what polygon the player is on top of. Since ...
0
votes
0answers
36 views

Collisions are getting ignored in child objects in Unity

I have a Character controller on child object not colliding with any object. I have also tried using colliders with and without rigidbody, but still character is not colliding with colliders. It is ...
0
votes
0answers
92 views

2D Collision detection on server side

Has anyone have experience implementing collision detection on server side? I am writing a top down 2D multiplayer game. All the players are constantly moving. I want to implement collision detection ...