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
2answers
41 views

BoxCollider not blocking other object(s)

I'm really newbie , watched about 20 videos about and tried to do something. But I still have problems with collisions. I'm working on 2D. I have a Sprite and a Cube (GameObject>3D Object>Cube). ...
0
votes
1answer
27 views

Is it possible in Unity to Flip a 2D Sprite Without Flipping the Object it is Assigned to?

I 'built' (followed a tutorial) on a collision detection system, and when I flip the object to go left and right the collision messes up. So I have three options; find a way to modify the collision ...
8
votes
2answers
103 views

How do I prevent raycast car wheels sliding sideways?

I've been writing a non-realistic car physics engine as a learning exercise, using this article as a reference. I have a car that correctly collides with a terrain and applies the correct suspension ...
4
votes
1answer
74 views

Predictive Collision Detection - Find Time Of Impact

I have a green box at a starting position A. It can move along two paths A to B is linear motion A to C is under the influence of gravity (non-linear) The thin vertical line is a fixed ...
1
vote
1answer
29 views

Where to put the screen dimensions to make it accessible for all on screen objects?

I'm starting game development to learn a new language (SDL2, C++) and would like some opinions on the best way to handle a probably very basic problem. I don't want my player to go off screen, so I ...
0
votes
0answers
23 views

XNA4\ Monogame 3d Collision detection Help please

i have been trying to get 3d collision working for a while and i think(hope) you people can help me so for my project i have created a 'sprite3d' kinda class which is called ModelEntity and there ...
2
votes
1answer
98 views

Smooth Wall Collision Detection

I've been working on a small game, and I've been stuck on the collision part. During the collision, when my player hits a block, he stops just as it should, but it then doesn't allow me to another ...
0
votes
0answers
14 views

Platformer Tile Map Collision Help

I've been working on a small platformer as a simple project but, I'm having troubles with my collision detection. What I want is that as the player falls due to gravity, it will stop when it touches ...
0
votes
1answer
26 views

(Unity) Drag and detect object below when dropping

I'm studying game development in Unity and I want to create a idle/clicker game like Cow Evolution. I'm using OnMouseDown, OnMouseDrag and OnMouseUp to move the GameObject around the scene. Now I ...
1
vote
2answers
30 views

On key press, spawn a collider where my player is facing?

I'm trying to create an attack mechanic to my player hero in my 2D Tower Defense game. When I press the Q button I want my hero to do an animation and spawn a temporary collider shaped as a cone at ...
1
vote
1answer
81 views

How to implement angled surface?

I'am trying to implement 2D platformer game inspired by N game. But the problem is I have no idea how to implement something like this: I have two ideas of how this could be implemented but i ...
0
votes
0answers
13 views

objects bouncing off of each other as collision response

At the moment, how I solve collision between 2 objects looks like this: (all the data of the objects is stored in float arrays, since its OpenCL) float impulseX = mass[id] * vel[id3 + 0]; float ...
0
votes
1answer
30 views

MonoGame - Left/Right Sided Collision Not Working

I'm working on a platformer as part of my course, the problem I have come across is Left/Right sided collision is not working very well. I already have bottom & top collision working. Here is an ...
4
votes
2answers
149 views

Best way to handle cornering in a 2D maze game?

I want to implement smooth cornering in a grid, much like Pacman moving in his maze. A big difference with Pacman, my characters can stop- thus the player has to keep pressing the controls to keep ...
0
votes
0answers
18 views

AABB in OpenCL not working correctly

I have this really simple OpenCL kernel. The values get in correctly and get out correctly. So the error must be somewhere in the kernel. All the parameters are float arrays. pos rot vel and aPos aRot ...
0
votes
1answer
25 views

XNA Line to Rectangle Collision return first pixel

I have the following code: public static bool LineIntersectsRect(Point p1, Point p2, Rectangle r) { return LineIntersectsLine(p1, p2, new Point(r.X, r.Y), new Point(r.X + r.Width, ...
1
vote
3answers
74 views

Collision Detection/Response Issues in Unity

Sprite A: Box Collider 2D and Rigidbody 2D. Sprite B: Box Collider 2D. Both sprites have a Sprites/Default material with Pixel Snap enabled. The textures being used are set to Truecolor Format and ...
3
votes
1answer
98 views

Calculation correct position of object after collision (2d)

I have a circle, that bounces of walls. The circle is traveling at the speed defined by px/s for x and y. I have collision detection implemented and I use vectors to calculate the new x/y speed (and ...
0
votes
1answer
42 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
34 views

QuadTree Checking Collision With Different Levels of Nodes

I am making a QuadTree for a 2D Platformer. Researched on it and I managed to make a pretty good one where each node stores its 4 SubNode and there's a MAX_OBJECTS for each Node and MAX_LEVELS which ...
1
vote
2answers
85 views

How to know from which direction there is a collision with an object? In Unity C#

In the game, there is a ball, and moving objects that can hit it. I want the ball to move when an object hits it. But the ball should move to the right direction, the one which the collision was from. ...
0
votes
0answers
21 views

How to use objects with different attribute values in Swift?

I think this is a really basic question and to make it easier to understand what I do not understand, I use the following scenario. Scenario: I have two or more ships in my game. They should have ...
1
vote
1answer
118 views

What are the disadvantages of R-Trees in collision detection?

I was poking around in SQLite and discovered R-trees. A little digging revealed that R-trees are really just fancy AABB-trees. Then I realize that the state of the art in collision detection (often ...
0
votes
1answer
60 views

Unity5x GetComponent<Animation>().Play(“sequence”.StopAll) not working

I'm working with Unity3D 5x using C#. I've attached collision detection to the character controller script that plays a "gothit" animation clip (using legacy animations). Here are the code snippets, ...
3
votes
2answers
222 views

2D Collision Detection XNA C#

I've read all around the net, watched videos, tried things and in the end I can't make a decent platform collision detection. I've followed this tutorial. It didn't work out at 100%. My object stops ...
0
votes
1answer
22 views

simplest way to detect collision with two bitmpas on android surface view

as title said. I have looked all over and havent found standard way to detect collision between two bitmaps on surface view. I tried intersect method with two rectangles, but didnt work. `practiseA ...
1
vote
2answers
63 views

Character controller passes through mesh collider

I need a little help figuring out what's going on with an NPC's character controller. Here are the character controller settings for the NPC. The problem I'm running into is that the NPC isn't ...
0
votes
4answers
101 views

Implementation of collision in 2D platformer (C++)

My collision system for my game currently works fine, it lets me test a collision with an entity or specified rectangle... but that's not enough. I used to use GameMaker and it had collision events in ...
0
votes
0answers
74 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
38 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
2answers
65 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
80 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
3answers
72 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
37 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
37 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
23 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
38 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
40 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
77 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 ...
4
votes
2answers
83 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
95 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 ...
0
votes
1answer
48 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
58 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
39 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
65 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
62 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
55 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
109 views

Using Physics.Raycast inside OnCollisionEnter2D function

void OnCollisionEnter2D(Collision2D collision) { foreach(ContactPoint2D contact in collision.contacts) { RaycastHit raycastInfo; ...
0
votes
1answer
86 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
65 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 ?