Questions tagged [collision-detection]

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

Filter by
Sorted by
Tagged with
0 votes
2 answers
482 views

Unity2D Collision Issue

I have a crate setup (in pic below) with a rigid body component, box collider and 3 circle colliders(they allow me to push the crate most of the time without getting stuck on the floor textures which ...
0 votes
1 answer
330 views

How can I split up a large model into an octree codewise?

For collision detection, I am attempting to split up a large model into an octree. If we take this black thing thing to be the ship (104,000 vertices): Then I would like to split up the faces I ...
2 votes
1 answer
1k views

Fast mesh collision 3D (C# XNA)

I'm trying to write a simple program where a 3D landscape can be walked about with a basic camera. However, I've found it very difficult to do even simple collisions with my terrain. I'm wondering if ...
1 vote
1 answer
107 views

How to implement this collision detection function?

I would like to know how to implement this collision detection function, but I'm not even sure what it's called. The input shapes are 2D convex polygons, with an optional "rounding radius": imagine ...
0 votes
0 answers
80 views

resolving per pixel collision issue

In space invader, I'm doing bullet to barrier intersection using rect to rect, then I'm testing the first bullet's impact pixel, if it's green I blast a circle, if it's black, it continues travelling. ...
0 votes
1 answer
160 views

missiles skip in collision detection

I'm trying to work on spaceinvader. I have problem that missiles or the bullets skip frames due to its fast speed. I tried to use the previous position of the bullet in the collision check, but still, ...
0 votes
1 answer
2k views

OnCollisionEnter2D incorrect contact point?

I am trying to shoot a bullet (rigidbody2d, boxcollider2d) to another enemy object (rigidbody2d, kinematic, circlecollider2d). I want the collision point between these two. When they collide, i want a ...
1 vote
0 answers
40 views

Colliding wiith a smooth line of blocks

I'm having a strange problem. I'm creating a 2D platformer, and creating the gameplay map by reading a csv file and placing prefabs of the appropriate type on map. One part of the map is a simple ...
13 votes
4 answers
8k views

Faster 2D Collision detection

Recently I've been working on a fast-paced 2d shooter and I came across a mighty problem. Collision detection. Sure, it is working, but it is very slow. My goal is: Have lots of enemies on screen and ...
0 votes
1 answer
81 views

Collision detection using gluunproject

I recently came across the game turbo tunnel. I want to make a similar game. only thing that stands in my way is the collision detection. I first thought of learning plane line collision detection. ...
4 votes
2 answers
2k views

How to resolve collision between a dynamic AABB and static AABB?

I wanted to ask, how do I resolve collision between 2 cubes - in my case I want to push a moving / dynamic cube (used for the player) out of another static cube (used for the floor or objects in the ...
3 votes
3 answers
2k views

Do I have too many colliders on my screen?

I'm running into a situation where my frame rate drops from 70 FPS (on my desktop computer) down to 5 FPS (on my iphone) and I'm trying to understand why. At the moment, I'm only drawing simple tiles,...
0 votes
1 answer
98 views

How do I make a time lapse in my code so it updates slower?

I have made some collision if statements, but they didn't work. ...
0 votes
1 answer
898 views

Collision Detection algorithm using Line Detection

For a 2D physics sandbox I am working on, I need a way of detecting detecting a collision using lines. This sandbox uses a class called Particle, which has a x and ...
3 votes
2 answers
3k views

Breakout Collision Detection: Ball gets trapped inside block

I'm writing a breakout clone where blocks to hit can be of various sizes and the projectile can move at different speeds, and I seem to be having some trouble getting the collision detection perfectly ...
2 votes
1 answer
454 views

Collision detection between axis-aligned bounding box and bitmap (pixel perfect) terrain

Working on a Worms-type game, I have my objects in bounding boxes and they sit on the pixel terrain. Currently I am able to successfully do the collision detection for objects when they enter the ...
5 votes
1 answer
417 views

Get normal dependent on collisions position

As I hask ask here I'm working on how my objects can move over the terrain and other objects. My proposal and also an idea in the answers was to calculate the rotation from the object with the normals ...
0 votes
1 answer
838 views

Rotate a plane defined by its normal and its distance

First apologies for the amount of pictures, it's a bit hard trying to explain my problem without pictures. Hope I've provided all the relevant code. If you feel you want to know about how I am doing ...
4 votes
2 answers
596 views

Jelly ground collision

For fun I am trying to replicate the mechanics from The Floor is Jelly. So far I have successfully created "jelly islands/blocks" which are represented by an array of points and then drawn by using ...
0 votes
2 answers
292 views

How to move a car over an environment

At the moment I'm writing a little OpenGL application. For now I have a car which can drive down a road. This works really good because I simply put the car on the street plane. Now let's say on the ...
4 votes
6 answers
4k views

Should my game handle collisions in the Player object?

I'm making a 2D platform game. Right now I'm just working on making a very generic Player class. I'm wondering if it would be more efficient/better practice to have an ActionListener within the Player ...
0 votes
2 answers
521 views

Collision detection with moving tilemap

I have a player whose who's sprite is 48* 32. I know the player's position. The player can move up and down based on user input. I have a tilemap which moves. Here is an example of the array I use to ...
0 votes
0 answers
286 views

How can I handle ball interaction with lanes in a pinball game?

In a pinball game, how can I handle collision or constraints on the ball for convincing movement on those highway rails/tracks? I assume using physics and a mesh collider would not work, even when ...
1 vote
0 answers
89 views

Collision Detection Between 3 or More Objects

Say I have a 2D grid of particles, and I wanted to find out if any of them were colliding. In my head I have come up with a system where you check every possible location for each particle in that '...
2 votes
3 answers
4k views

unity destroy enemy when jumping on it

I am creating a 2D platformer using Unity3D, I want to have the player destroy enemies when it jumps/falls over them (just from the top). But I have been having problems trying to implement this. I ...
3 votes
1 answer
2k views

OnMouseUpAsButton not always called

I'm working on a 2D implementation of Free Cell in Unity 4.6.1, and I'm having trouble getting my click-detection code working consistently. The code below should be called every time a card is ...
1 vote
0 answers
154 views

Is there a way to rotate an Ellipse in libGDX for collision detection purposes?

I'm trying to avoid having multiple overlapping Circles for a UFO-shaped sprite. Two Ellipse objects will perfectly cover the shape of my UFO, but I want to tilt/rotate the UFO when flying left and ...
2 votes
1 answer
4k views

Unity: Smooth collision

I'm making a topdown 2D RPG in Unity. All moveable objects have Rigidbody2D-components with gravity set to 0, linear drag set to 5 and different masses. Walls are stationary boxes with BoxCollider2Ds. ...
-2 votes
1 answer
249 views

How can I get "Good enough" collision for entities? [closed]

I am developing a Pirate ship fighting game. It's a great concept: Ships firing cannonballs, sinking each other, having to work as a team to complete the mission... But.. I've tested it with about 20 ...
0 votes
0 answers
37 views

How does collision detection work? [duplicate]

I was curious on how hit collision works in games. I know there is a simple method that gives every object in a 2D or 3D world a recengular hitbox that makes it easy to detect a collision, but when ...
14 votes
6 answers
7k views

What's the fastest way checking if two moving AABBs intersect?

I have two AABBs that are moving, what's the fastest way to check if they will intersect under a frame? By moving I mean not just to check with the usual rectangle intersection method, I mean some ...
1 vote
1 answer
493 views

Applying statements to a single instance in Game Maker?

I'm currently in the process of making a platformer, and am currently in the process of creating "depth" into my game, by making Up/Down-W/S control your depth. (Come closer to screen, go further). ...
0 votes
1 answer
227 views

Ray->triangle collision math seems to not work?

First time asking, pardon any mistakes I make :) I am programming a game from scratch, and the collision detection is giving me issues. I have AABB in place to check proximity, and if that reacts, ...
0 votes
2 answers
1k views

Accessing colliders from one script C#

I want to access specific colliders(to see if they are been clicked) from one script insted of making multiple scripts for every collider.How? I am using unity. ...
1 vote
1 answer
467 views

GJK point-in-tetrahedron - capping the number of searches?

The very informative mollyrocket video has given me quite a lot to work with, but one thing that the video seems to suggest is that the algorithm should ideally run until it definitely determines ...
1 vote
1 answer
532 views

Set box collider size in meters instead of percents

TL;DR: Can I set the size of a collider in meters instead of fractions of the size of the object it's in? I'm implementing a classic NES game, and my scale is 1 meter = 16 pixels. I have an 8x1x1m ...
2 votes
4 answers
8k views

Checking for collisions on a 3D heightmap

I have a 3D heightmap drawn using OpenGL (which isn't important). It's represented by a 2D array of height data. To draw this I go through the array using each point as a vertex. Three vertices are ...
1 vote
1 answer
615 views

Seeking Advice: Collision with JBox2d for Top-Down or Isometric Maps

I Hope I can make this as clear as possible! Currently working on an action RPG game, very early stages, more just the basic ideas down and written in. So i'll start on with my setup: Using Java ...
0 votes
1 answer
114 views

How to reposition a bouncing ball after it has passed through a surface

I have a bouncing ball which can collide with lines of a random slope. The ball passes through the lines a bit and I need to set the ball back some distance from the line. The ball (defined by ...
0 votes
2 answers
295 views

Stuttering Character When Colliding With Wall XNA 4.0 Help!

I'm trying to make a platformer game without tiles. I've made a collision handler to handle collision between Player and Stage(platform)and a collision checker, here's the code: ...
0 votes
1 answer
1k views

How do I calculate the bounce vector of a ball hitting the starting point of a segment?

I have a ball (with parameters x, y, radius) that travels on the screen (with vectors directionX directionY) and can collide with a segment with random slope (with parameters startX, startY, stopX, ...
11 votes
3 answers
5k views

Isometric Collision Detection

I am having some issues with trying to detect collision of two isometric tile. I have tried plotting the lines between each point on the tile and then checking for line intercepts however that didn't ...
0 votes
2 answers
2k views

Unity2D Best way to determine degrees between two colliding entities?

I'm trying to determine the collision-direction between two objects. I'll be using this for various things such as creating blood-entities in a specific direction proportional to where the other ...
3 votes
2 answers
4k views

Do resolution settings have any impact or give any advantage in online FPS games?

There is this crazy theory that has always bothered me. I am not after a technically but more theoretically (although technical knowledge is required to) answer; Two friends are playing the same ...
1 vote
2 answers
257 views

XNA/Monogame inverting a BoundingBox

I have a box that is drawn around my game that I want to check collisions with. Currently my BoundingBox is made in a way that whatever is inside the box is ...
1 vote
1 answer
1k views

Environment collision in a pseudo-3d 2d space

The game is a 2D brawler with depth movement in the vein of Golden Axe, Final Fight, Castle Crashers etc. Characters and environment are all 2d sprites as well. I've had no real issue setting up ...
1 vote
2 answers
7k views

Unity Physics Material - Character Slides Too Much

I am currently working on a 2D platformer in Unity. I am using a prefab from the AssetStore for my character (The last paragraph contains a link to the prefab). The character has a circle collider for ...
3 votes
5 answers
6k views

Collisions reflecting ball velocities incorrectly

Ok so this is for a small uni project. My lecturer provided me with a framework for a simple brickbreaker game. I am currently trying to overcome to problem of detecting a collision between the two ...
5 votes
2 answers
3k views

How do I resolve a collision of a rectangle with two rectangular tiles at once?

I am having some problems with collision detection between a player and the environment in a tile-based game. I have a player objects, Tiles and what I call ...
0 votes
2 answers
2k views

Collision Direction Detection

I'm making an RPG game where players and enemies can collide with walls. Right now it pushes the player off the wall when he tries to 'go through' it. However, I detect which way he should be pushed ...

1
31 32
33
34 35
50