# Tagged Questions

Collision detection is the determination of whether or not two or more entities make contact with each other during gameplay.

92 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". ...
262 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 ...
198 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 ...
63 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 ...
27 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 ...
125 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 ...
74 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) { ...
52 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 = (Math.cos(angle)...
104 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 ...
151 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 ...
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 ...
29 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 ...
37 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 ...
171 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 ...
136 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 ...
143 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 ...
112 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() ...
67 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 ...
30 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. ...
129 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 ...
99 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 ...
103 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. ...
118 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 ...
74 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 ...
60 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 ...
47 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 ...
176 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. ...
34 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 ...
22 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 ...
118 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 ...
103 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 ...
183 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 ...
137 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 ...
33 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 ...
271 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 ...
89 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 ...
38 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 ...
74 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 me....
48 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 ...
63 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 ...
57 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 ...
54 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 ...
111 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 ...
69 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: http://www.gamedev.net/page/resources/_/technical/game-...
93 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 ...
184 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 ...
86 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 ...
16 views

### 2D Platformer Incrementing Speed Physics/Collision problem [duplicate]

I am currently developing a game on Cocos 2d-x physics engine. The game's mechanic is so that the character goes down faster as the game progresses (a casual game) however, there seems to be a problem ...