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

How Can I Make These Collisions Work Outside Of Unity's Built-In? (C#)

I'm having some trouble working out what's wrong with my code. Basically I want to have my player be able to collide with obstacles it's flying through. So I have an obstacle, and a pathway or two ...
0
votes
1answer
29 views

How to detect a collision between a isosceles trapezoid and a circle

I figured one approach would be to divide the trapezoid in three parts, two triangles and a rectangle in the middle. Then for the circle-rectangle case I would check collision like this: function ...
1
vote
1answer
27 views

How can i handle collision response in a voxel game?

I'm making a voxel game with cubes - like in minecraft - and I have figured out how to check wether the player is colliding with a voxel, I have just done it by checking wether the player is within a ...
2
votes
1answer
60 views

How does matrix based game physics (collision detection & response) work?

I'm familiar with how to do collision detection and response using shape intersection tests, the separating axis theorem, and by using MPR and GJK with minkowski sums and support vector defined ...
0
votes
0answers
35 views

Check if body is on the ground

In my game I have an quite irregular terrain at the bottom and a round ball which can be controlled by the keyboard. Is there any way to check, if the ball is currently on the terrain? This is very ...
0
votes
0answers
28 views

Why are my smooth curved meshes bumpy?

Reference .gif of what I'm experiencing I've been trying to create smooth surfaces for my game in Blender, mostly curved ramps. However, for some reason I can't get the ball to roll smoothly along ...
0
votes
1answer
20 views

Is it possible to detect contact with every frame change when using an animation in SpriteKit?

Is it possible to detect contact with every frame change when using an animation in SpriteKit? For example, if I have two nodes of a person walking, I want to detect contact with the ground each time ...
0
votes
0answers
20 views

Where to put collision detection and resolution with Verlet Velocity?

I've implemented a 3D Verlet Velocity integrator with variable-velocity forces following this awesome answer: How can I implement gravity? I've used only freely-moving spheres for now, applying ...
1
vote
1answer
33 views

Objects phasing through each other in physics engine

I'm writing my own physics engine right now (following this tutorial), but I'm running into some problems. Sometimes on collision, objects will just phase through each other instead of bouncing off of ...
1
vote
1answer
33 views

How to go about an intermediate collision resolution system?

I would like to know a better way of collision resolution than I am currently doing. My current collision system stores the current positions and previous positions of each object. When an object ...
1
vote
3answers
69 views

Best collision algorithm for Axis Aligned Bouding Boxes [duplicate]

I have a number of quads (suppose like 20-40) and i want to quickly check the collisions between any of them. I would like to know if there's a quick algorithm to do that 60 times per second without ...
2
votes
2answers
49 views

Unity3D Get collision without having Rigidbody

I am trying to detect a collision between 2 objects, each one of them has a Collider component. In the script I have the method OnCollisionEnter(Collision other) where I want to check if the collided ...
0
votes
2answers
73 views

Why does player still leave map?

I'm making a simple HTML5 RPG in pure JavaScript likened after Nox, Diablo or Titan Quest, with the character centered on the screen and the map moving around it. TL;DR: My character, when colliding ...
-2
votes
1answer
22 views

Trying to Create a Sprite Wall [closed]

I am trying to develop a Android Game using Canvas and Animation Sprites in a SurfaceView. I didn't have any issues creating the Animations but my problem is now that i would like to implement a Wall. ...
0
votes
1answer
40 views

Collision with player following mouse

I'm making a RPG with libGDX. I've loaded a TiledMap and now I'm implementing the player movement. The view is top-down. In my game I want two ways of input: one is using the ARROW keys to move the ...
1
vote
1answer
48 views

How can I determine “exact moment” of collision with ray casting?

I'm currently brainstorming how the physics for my game engine is going to be handled. It's top down and I'm thinking of using ray casting for collision detection. I've reached two potential problems ...
1
vote
1answer
31 views

How to resolve collisions when using ray-casting to predict the location of future collisions?

I ran into a question I can't seem to solve, while implementing the movement/ collision checking code for my game. The game is in 2D and all objects in my game use either AABBs or circles as collision ...
2
votes
1answer
61 views

Organizing movement, collision detection, and collision resolution

There's many articles on the internet focusing on how to implement movement, collision detection, or collision resolution. What I'm wondering is how to put them together, specifically in what order to ...
0
votes
1answer
55 views

How does collisions caculates when developing game in Build an HTML5 Game book

I don't understand authors login when calculating collisions between two circles (bubbles). Here is the Calculating collisions section. Author writes: The bubble being fired follows a set of ...
0
votes
1answer
33 views

LibGDX: Colllisions between bullets and enemies in arrays

I am writing a "Gauntlet" style game. So far I have managed to successfully detect collisions between my player object and my ghost enemy objects, and when they collide they drain the player's energy. ...
-1
votes
1answer
105 views

Using Physics.Raycast inside OnCollisionEnter2D function

void OnCollisionEnter2D(Collision2D collision) { foreach(ContactPoint2D contact in collision.contacts) { RaycastHit raycastInfo; ...
0
votes
1answer
51 views

Tile map collision C++, SFML

My problem with the collision here is more to do with how to decide which tile the player is in. Each quad of the map is 16 pixels squared (Vertex array), and the player moves in 1 pixel jumps. ...
1
vote
1answer
42 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 ?
4
votes
1answer
99 views

How do I check for collision between transparent textures?

I am creating a 2D game using OpenGL. For sprites, I use textured quads (actually two triangles). The texures contain transparent pixels, since objects are not always perfectly rectangular. How do I ...
1
vote
1answer
71 views

Clip shadow frustum to scene bounds

I have a global light in my scene. It casts shadows using shadow mapping and has an associated camera (for rendering to the shadow map). I'm going to refer to it as my "shadow camera" from now on. I ...
-1
votes
0answers
21 views

platformer side movement collision problem [duplicate]

I making a game in javascript and I'm stuck, the player will stop moving if he hits the left side and if I move left a little bit and try to move right again I cannot. My question is: Whats wrong ...
1
vote
0answers
39 views

Efficient Collision detection for polygons (fleet) in an RTS

I'm trying to make an RTS for android using libgdx. I would like to have collision detection to be able to detect ships inside the range of weapons and collision between my bullets and the ships. So ...
1
vote
2answers
58 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 to bodies collide collision is detected multiple times. here's the code `public void preSolve(Contact contact, Manifold oldManifold) { Body a = ...
0
votes
1answer
37 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: ...
1
vote
0answers
30 views

Implementing Separating Axis Theorem to Detect and Handle Sliding Collisions

I am having a bit of difficulty detecting collisions properly with separating axis theorem. My code seems to be giving a lot of false alarms. Also, I've looked into implementing sliding collisions ...
2
votes
2answers
48 views

Detect collision that happen between frames, between slices of moving, rotating circles?

To detect a collision between two circles, we check if the distance between their centers is smaller than the sum of their radii. To detect a collision between a slice (in this case half) of a circle ...
0
votes
2answers
48 views

Efficient Collisions Iteration?

My project has upwards of 3000 2D objects but not all of them collide with each other. Between each object that can collide, a CollisionPair is created and stored inside a flattened array. Currently, ...
4
votes
2answers
663 views

Wall detection in maze game - On the fly or precomputed?

I've been a programmer for over a decade, professionally for the last five years, but I've never really done any games programming. I've had a look at some tutorials but most of what I've found is ...
0
votes
0answers
25 views

Libgdx polygon ratating

I'm using polygons for collision detection. Here is the code: poly = new Polygon(verticies); poly.setOrigin(100,100); poly.setRotation(45); renderer.setColor(Color.GREEN); ...
-3
votes
1answer
40 views

Collision detection console log errors?

So the code down below is supposed to load the next scene once the player touches the flag which the code is attached to. I've made sure that is trigger is checked and yet I'm still getting errors ...
0
votes
1answer
47 views

How do I have different colliders against different objects? Unity

Say for example I have a ball, I want the sphere collider to be a certain radius when it comes into contact with one material (material A in diagram) and a different size when it comes into contact ...
0
votes
1answer
47 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
1answer
20 views

unity onCollisionEnter does not work

I know this question has been asked several times but none of the answers solved my problem. I made an sphere and gave it rigidbody. then I draged the sphere on to a new made prefab. on mouse-click ...
1
vote
1answer
62 views

Voxel terrain collision detection with AABBs

I'm working on implementing collision detection on voxel terrain (Like Minecraft) with AABBS. Right now, I have it so I can tell if a point is within a voxel or not, I do this by having a 2D byte ...
3
votes
1answer
88 views

Is it really necessary to test collisions against triangle vertices and edges?

I'm reading this paper, and using it to perfect the narrow phase collision system for my game engine. To make the question as self-contained as possible, the essential strategy used to detect ...
-1
votes
1answer
88 views

How to optimize my movement & collision code?

I am trying to implement movement & collision the simplest way possible. public void MovePlayer() { KeyboardState keyState = Keyboard.GetState(); Vector2 checkVec = ...
1
vote
1answer
41 views

Is my collision-free location script working?

I've recently been learning C# and I wanted to take one of my 2D tutorials to Unity. I reached a step where I need to spawn my new sprite into a collision free location. I've followed direction - ...
0
votes
1answer
71 views

LibGDX obstacle collision

How can I handle collisions with obstacles in LibGDX? Is there any automatic way to stop the character's movement when it collides with a wall or I have to constantly poll for all the possible ...
1
vote
1answer
26 views

How to iterate a sprite group correctly in Pygame avoiding “maximum recursion depth exceeded”?

I'm making a game and I have almost finished it, but I'm usually finding the error RuntimeError: maximum recursion depth exceeded when I iterate a sprite group. This is an example and the group is ...
2
votes
1answer
37 views

Platformer Collision in javascript

Hi im making a platformer in javascript and this is the collision function that I have if(obj2.y > obj1.y + obj1.height || obj2.y + obj2.height < obj1.y|| obj2.x > obj1.x + obj1.width ...
4
votes
1answer
132 views

Half top-down view collision and mechanics

I'd like to create a game with a half top-down (2d RPG) view (I don't know the exact name of it). It would be 2d, but I'd like to add 3d-like collisions. For example: If the grenade lands on the ...
-1
votes
1answer
47 views

Getting stuck going left with tile based collision detection [closed]

Thanks to Alexandre Desbiens I have awesome collision detection. I can just slide right along walls. However if I try to go left into a wall I get stuck. But the good news is I can just back out and ...
3
votes
1answer
176 views

Roguelike 2D Collision Detection

I'm just a normal guy trying to do some basic collision detection but I suck at it. I either get stuck in a wall or I go in reverse in the wrong direction trying to update the player position to a non ...
-1
votes
1answer
27 views

Collision problem JBox2D

I work with Processing and the JBox2D library and wanna code a new Ping Pong game. But if I move the player to the top border (or lower border), he collide on a wrong position. The picture shows ...
2
votes
1answer
57 views

Java: Problems with Tile Collisions

I have created a tiled map using a BufferedImage (img) from a PNG. From that, I would like to detect the player's (peter) collisions with individual tiles on the map. However, my code will not run and ...