The Wayback Machine - https://web.archive.org/web/20160413112849/https://gamedev.stackexchange.com/questions/tagged/collision-detection

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

Make Kinematic P2 Body collide with world bounds

I have a P2 object( A) with a custom bound that detects collision with another P2 object(B ). However, object A is set to be kinematic rather than dynamic as I do not want object A to react to ...
1
vote
2answers
71 views

C++ Platformer Collision

This is very simple, but I have spent nearly 6 months messing with this and it is always messed up. This is a tile platformer, everything is "normal", x and y correspond to tile. Tiles are 32 x 32 ...
1
vote
0answers
13 views

Phaser - Add collision to a specific tilemap layer?

In Tiled I made two layers, "Background" and "Walls" and I have positioned them accordingly, both as a background and walls, or if you prefer "Not being able to collide" and "Being able to collide". ...
0
votes
1answer
33 views

libgdx - Math for wall collision when adding velocity

I've created a game which spawns a random colored ball in the top or bottom of the screen and moves to random direction with this method. private Vector2 position; private Vector2 velocity; private ...
0
votes
0answers
7 views

c# adding object collision to multiple objects

I'm trying to make a mario, platformer type game, and from following a tutorial, they've done the collision like this, but im wondering if there is a simpler way to it since I want to have collision ...
1
vote
2answers
14 views

Tiled height level collision

I have created the below tilemap in tiled and I am wondering about a good approach to "separate" these two different heights in the map. I would like to keep it tile based, so adding a object layer ...
0
votes
0answers
14 views

Box2d capsule stumbles on ground

I am working on a game with box2d and sdl. I Created a character and some boxes as ground, but faced the problem where the character would run a few meters, and stumble on one of the boxes' edge. I ...
1
vote
1answer
112 views

Collision isn't working in pong

I've posted about another pong problem a while ago, but now I'm having another problem with the ball collision with the paddle , when the ball collides, it doesn't bounce back, why is that? Here is a ...
0
votes
0answers
16 views

Collision Between SKSpriteNode and SKShapeNode

Im trying to create a collision between to objects. one is a SKSpriteNode and the other is a SKShapenode. the Code I have so far for Contact is : func didBeginContact( contact: SKPhysicsContact) { ...
0
votes
2answers
47 views

need to make a ball travel in the angle it was hit from

self.hitBall = function (ball, x, y){ var angle = Math.atan2((x - ball.centerX), (y - ball.centerY)); ball.velocityY = (Math.sin(angle) * 10); ball.velocityX = ...
0
votes
1answer
25 views

Bounce with multiple collisions

Here's the problem: I'm writing arkanoid-like game in Unity 5.3. I'm using 3d physics and simply ignoring z-axis in computations. No gravity, 0 drag and velocity reset every bounce by script. My ball ...
0
votes
1answer
28 views

Unity mesh collider detecting collision on object empty inside

I'm trying to get my first 3D game done with Unity. In this game the character will be flying through some rings. I made the ring asset with MagicaVoxel, exported it in .obj and reimported in Unity ...
13
votes
2answers
2k views

Storing coordinates of every object in server side in MMOs

In an MMORPG: Is it typical or feasible to store the coordinates of every tree, bush rock.. etc in the server side for collision detection? If so, what would be a feasible way to store such a huge ...
1
vote
0answers
27 views

Exact collision detection for high-detail deformable triangular meshes

What robust methods or approaches exist for exact collision detection involving high-detail, deformable geometry? The kind of mesh I am describing is a surface that is specified as a triangulated ...
0
votes
0answers
18 views

Detecting collision between 2 convex meshes in 3D

For the past couple of weeks I've been trying to implement physics in my engine, and I am currently stuck on the collision detection phase. In short, I can perform a triangle-triangle intersection ...
3
votes
2answers
126 views

Need help with a field of view-like collision detector!

I ran into a trouble while making a field of view for my character. I figured how to make it work with a Linecast, but what I really need is a cone-shaped field, so that the character can detect ...
3
votes
0answers
54 views

How to determine contact bodies when multiple bodies overlap and a third makes contact with both at the same time

I understand how the below DidBeginConact function works, but how do you detect which categories make contact when you have multiple colored bars (in the example code) or a friend category and enemy ...
0
votes
1answer
43 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
105 views

Collisions being detected before objects are intersecting

I'm making space invaders (in OpenGL/SDL) and I'm currently having issues with getting the collisions (box collisions) between the bullets and the enemies to be properly detected. In my update() ...
2
votes
2answers
47 views

Java: problem with 2D corner collision

:) It took me many days to create a working collision detection for a 2D java platformer... I am finally calculating the corners of my player but the system is still buggy and I hope that we can ...
0
votes
0answers
22 views

Collision logic with Animations Java

Im trying to code a tile based platformer game with slick2d. While handling the collisions, Im facing with this problem. I could fix it for only that situation but I guess there must be a better way. ...
-1
votes
2answers
116 views

Inconsistent AABB collision detection

I'm making an endless jumper as my first game and I'm running into some problems with the one-way collision detection. Collisions are detected correctly most of the time but occasionally the player ...
0
votes
1answer
47 views

Collision between UI element and GameObject

When I first started to develop in Unity I followed the Unity Tutorial for the Space Shooter 2D game and used the knowledge from that to create something myself. Looking at it now it may not have been ...
4
votes
1answer
98 views

Should particles check if they are in a region, or regions if particles are in them?

I have around 100 to 200 particles in my game. Then I have 5 to 20 regions (circle-shape) which should count the particles which enter them and add some force to them, so they change their direction. ...
1
vote
2answers
75 views

How to destroy bullet on collision but only after it makes the collided object to bounce?

I made a scenario that shooting a bullets on crates make them both bounce nicely (both the bullet and crates are RigidBody2D & Colliders). When I use OnCollisionEnter2D to destroy the bullet when ...
1
vote
1answer
63 views

How could I implement destruction of bases in Space Invaders type game?

What approaches could you use to implement the the gradual destructions of bases/shields in a top down shooter type game similar to Space Invaders? The simplest approach could be to use a series of ...
0
votes
2answers
33 views

how to recieve a trigger with collider or recieve a trigger with collider in unity

i know if your object has a Collider you can sense another Collider with OnCollisionEnter function or... and you can sense another collider with trigger with OncollsionEnter function and... but i want ...
0
votes
1answer
39 views

Play an effect where a sprite touches a trigger

I have a sprite-based GameObject in Unity to which is attached a RigidBody and a Collider2D. When this GameObject comes into contact with a particular Collider2D Trigger, I want a particle effect to ...
0
votes
2answers
53 views

Picking a 2D Box Collider with the mouse in Unity

I have a scene with a bunch of 2D doors that have 2d Box Colliders (no trigger) on them and that live on a Canvas. I would like to be able to click on them with the mouse, but have had no luck. ...
0
votes
0answers
32 views

Doing collisions on both axis with java overlap

I'm making a top down game from scratch and just found out about the java rectangle overlap method that would work great for collisions. However, after the overlap happens, I need to check for which ...
0
votes
0answers
20 views

Pleats and folding

We have a C++ module that produces mesh dynamically and simulates it with a physics engine. We want pleats on the surface of our mesh, pleats that remain sharp and folded during simulation while ...
0
votes
0answers
44 views

HingeJoint shaking, Unity3D 5

I have player with CharacterController and door with HingeJoint, I also have enemies with NavMeshAgent. When someone gets inside this door, it starts shake, jitter, rotating etc. For player I use this ...
1
vote
1answer
55 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 ...
0
votes
4answers
106 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 ...
0
votes
1answer
76 views

Unity 5.3 C#: How to disable multiple game objects with one collision?

I'm making a top down perspective game with a gunner automatically moves on a pre-set path, and you shoot and destroy targets to remove barriers. The idea is that you control the bullet's direction ...
0
votes
0answers
29 views

How to find visible planes in a world of boxes

I have a world where each object is a box: Each box has position x, y=0, z, dimensions width, height, depth. The boxes are never rotated. Each box is composed of 5 planes (left, right, front, back ...
0
votes
1answer
201 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
1answer
54 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 ...
0
votes
0answers
31 views

LibGDX & Box2D Actor Collision

I'm working on a LibGDX project, and I was wondering about the best way to define actors in a collision. I know this is probably a common question, but specifically I'm interested in beefing up one ...
1
vote
2answers
53 views

HardonCollider Error: attempt to call method 'addRectangle' (a nil value)

I want to add collision detection mechanism to my game, which is written in love2d. As i do not want to implement my own algorithm, i have found a HardonCollider library to do the heavy lifting for ...
0
votes
0answers
42 views

How to get many rectangles and join them together into one polygon

I'm using LibGDX to make a platformer game in which I have a tilemap containing lots of instances of a Tile class. From the Tile class you can return a rectangle which represents the tile's position ...
0
votes
0answers
54 views

Making the CCTV and its Detection Area Pointing to the Player on Unity 5

I am now playing with the Unity Stealth project. Goal I want to make the CCTV pointing to the player (a sphere) instead of playing its rotation.y animation when the CCTV detection area is detecting ...
1
vote
0answers
30 views

2d Circle different ARC's Collision detection

The way to detect collision between 2 circles or circle and line . using trigonometry But now i like be able to detect which part of the circle arcs im hitting , for example i divided my circle to 4 ...
0
votes
0answers
45 views

Detect collision without reaction

Okay, so this has been bugging me for quite some time now. I'm making an old school platformer type of game in 2.5D, I want objects to pass through each other, but I still want a collision to be ...
0
votes
2answers
78 views

Get Particular Object's collision status via C# script

My current scripts creates and modifys the location of various prefab objects as they go along the screen. One of the things I want to find out about the active object is whether it has collided with ...
0
votes
1answer
71 views

Libgdx rotate sprite with collision

Im making a game where I have an object in the center of the screen and then balls come out from the sides of the screen. When you touch the screen the object rotates 90 degrees clockwise and it has ...
1
vote
1answer
49 views

Swept AABB Collision and Response Problems

I am working on a simple 2D game, and I am having problems with collision detection and response. I am using code adapted from this article: ...
-1
votes
1answer
85 views

Bullet only removing closest enemy

I'm having an issue with my collision detection code. I'm making a top down shooter and when I shoot, the bullet will only destroy an enemy if it's the closest enemy. The bullet will go right through ...
0
votes
1answer
91 views

My character gets stuck when It's running on a straight level ground

My project is an infinite runner that goes right in a straight line. Sometimes when it just runs without jumping the Player stops. Sometimes the Player doesn't stop. When you jump the Player usually ...
1
vote
1answer
80 views

Check collision with rectangle and pixels

I have done a function to check the pixels collision against two animated sprites, and now I need to check a "Rectangle x animated sprite" collision, but I have no idea how to do this. I tried to ...

close