The determination of whether or not two or more entities make contact with each other during gameplay.

learn more… | top users | synonyms (2)

2
votes
0answers
29 views

Why is OnCollisionEnter2D called when it's layer's collisions are being ignored?

I'm sure this is down to my lack of understanding of the unity physics system. I'm trying to implement a simple one-way platform for a 2d game and have got stuck on creating a reliable way to let the ...
3
votes
2answers
87 views

Find a position within one radius, but outside other radii

I have an Object A which will attempt to stay within a certain distance of another Object B. I would like Object A to also try to stay outside a certain distance of one or more other Objects R. ...
1
vote
0answers
86 views

How do I detect collisions between a particle-based net and a ball?

I've implemented a net using Verlet integration and many points connected with constrains; like this demo, but in 3D. I want to implement collision detection between this net and a ball (like in a ...
2
votes
1answer
110 views

Collision detection between 2 irregular shapes

I need to implement a collision system for a vertical-shotter and the bullets can have any type of shape; i've implemented the shape class with an array of choords and an array of lines which have the ...
0
votes
1answer
54 views

How do I raycast to detect which hexagonal tile was clicked?

I want to detect the hexagonal tile a unit is on upon clicking on the unit. I was thinking of using a ray cast I can't get it to work. I'm trying to get the raycast to shoot from the bottom of the ...
1
vote
0answers
70 views

How do I implement melee hit boxes for a top-down game?

For a 3D top-down game, how should I handle collision in melee combat? My game has no targeting system, so I can't use a simple distance check between attacker and target. What I am thinking is have ...
0
votes
0answers
34 views

How can I have an RPG character redirect / glance off stationary objects and keep going? [duplicate]

I am attempting to create an effect in a game that is identical to the effect I've shown in the attached gifs. Essentially, the character, when they are running or walking and hit an object that is ...
2
votes
2answers
84 views

How to preserve topology for penetration correction?

I have a sorted list of blocks - some may overlap some may not. Each block has an ideal starting position and may be constrained to one axis. There are no velocity or acceleration or other forces ...
1
vote
1answer
80 views

Minkowski Portal Refinement collision detection algorithm

Preface: While I was learning the basics of collision detection, I read in various places that the SAT and GJK algorithms don't natively return contact points. So I decided to research the MPR ...
0
votes
1answer
84 views

2D physics collision/gravity problem?

I'm using Love2D and my own physics engine to create a 2D platformer. Y collision works fine, but X collision... well, it's a bit buggy. When I move off of a small platform I've created, I fall but it ...
1
vote
0answers
36 views

A problem with collision when a sprite changes size (Phaser framework)

I have a sprite in my game that changes size at certain points in the game. It changes size via the sprite.body.setSize method. Unfortunately, it seems that the sprite is unaffected by objects that it ...
2
votes
2answers
99 views

Detecting mouse clicks in Unity UI Beta

I want my game script to detect mouse clicks everywhere on my screen, except one corner where I have a pair of buttons to control the sound and will be handled separately. To help identify this ...
1
vote
1answer
82 views

Collision detection across multiple components

I have been reading this article: http://gameprogrammingpatterns.com/component.html which describes how a game object should be constructed out of components. It also encourages the decoupling of ...
1
vote
1answer
65 views

Animation-based Collision Boxes

Background I'm currently working on a top-down 2D game, roughly similar to something like Zelda for the SNES. Certain game entities such as the player or a typical enemy will consist of multiple ...
2
votes
1answer
122 views

Implementing one-way platforms in Chipmunk

I am making game in cocos2d-x, but it's the first time I am using a physics engine i.e. Chipmunk. (It's built-in to cocos2d-x.) I want to make a one-way platform: When my character jumps into a ...
0
votes
1answer
70 views

Unity Guitext object always triggering a collision - 2D

I have a guitext object which I can drag. I have attached a 2d rigid body. I have also attached the collider with the following code: void setCollider() { Rect box = ...
0
votes
0answers
48 views

Very strange trigger behavior in Unity2D (4.5)

I am developing 2d platformer and I've faced with a very strange triggers behaviour in Unity. I have made the enemy that can throw objects into main player. So I have made two empty GameObjects with ...
1
vote
1answer
37 views

Trying to implement bounding box collision

I've been trying to do collision detection using the Intersects() function with two rectangles. I've got a player and multiple enemy's. When the player intersects with an enemy a bool var is set to ...
0
votes
1answer
90 views

SHMUP: who's in charge of collision detection? [duplicate]

Simple design question here: In a Shoot'Em Up, where you often have to deal with hundreds of bullets / missiles / weird flying stuff, who's in charge of detecting collisions? The weapon or the ship? ...
3
votes
3answers
129 views

Lerping character moving up and down slope tiles

So, when interpolating position against a standard 'horizontal' platform, everything works great. What happens is something like this..... (Question continues after graphic) Now, the question I ...
2
votes
1answer
58 views

Pair collision detection on quadtree

I'm planning to use a quadtree for optimizing collision detection. But this quadtree can handle only one type of objects (so I used a base class for my objects). If I use double dispatch after two ...
1
vote
0answers
96 views

Collision detection implementation suggestions

I'm working on a simple 2D game involving a rotating octagonal ring where a sphere sprite moves up/down avoiding objects as the ring rotates faster and faster. I'm having a difficult time with the ...
2
votes
2answers
64 views

Rendering after interpolating, renders inside/outside other objects

So, we're working out our interpolated render-coordinates during our render call and it's doing a fantastic job of smoothing everything out. All is great and collision detection is working to a ...
0
votes
1answer
48 views

Crafty - How to get the id of the collision element?

As the topic says, I want to know how to get the ID of an active colliding entity. My Player Entity is called with Crafty.e("Player") Please notice, that I do not want the ID of my Player Entity. ...
0
votes
0answers
29 views

Locate point of collision for two moving lines

I am trying to implement a continuous collision detection system that checks collision between two polygons for a certain time step, concave or convex. It makes the simplification that the path ...
1
vote
2answers
124 views

How to do collision detection on marching cubes terrain?

I'm writing the physics part of my game engine. The world uses the marching cubes algorithm on a 3d perlin noise to make the terrain. How do I do collision detection on the resulting mesh? I can't ...
0
votes
1answer
123 views

Getting a pixel of Sprite at the cursor position in Unity

Summary: I've been trying to figure out a way to use simple box colliders as a nice and efficient "first pass" collider. For the "second pass", I want to check that the area clicked has an alpha value ...
0
votes
1answer
54 views

Collision bug with gravity in slick2D

I have fixed some of the previous problem. The collision when running into a corner(a wall on two sides) however is still not working. When the player runs into a corner he just falls down and out of ...
0
votes
2answers
79 views

Depth of overlap between circle and rectangle

I have a circle and a rectangle one of the two objects is moving the other is static. How can I prevent them from overlapping each other? For now there is only one thing that I don't know how to ...
0
votes
2answers
75 views

Vertical Collision Detection, Falling Through Ground

After much work trying to learn collision system theory and apply it, I've got my collision system working for the most part. The player can collide horizontally with no issue, sliding against walls, ...
0
votes
1answer
37 views

Calculate an approximate distance between two rigid bodies or OOB

Is there any easy way to get an approximate distance between two OOB? I searched around and people talk about GJK algorithm, however I don't see it returning the distance between two convex objects ...
0
votes
0answers
29 views

How to determine positions to draw lines on a screen with AndEngine

I have a screen (480x800), M(mx, my) is a static point, and N(nx,ny) is a dynamic point on screen. Position of N(nx, ny) depends position of touch. I want to determine position of P(?,?) and Q(?,?) to ...
0
votes
1answer
125 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 ...
2
votes
1answer
84 views

How to calculate max region/area of 2d circles?

I have some 2d circles on a plane, each has its own minRadius and maxRadius. When two circles collides, both of them will shrink their radius, so the actual radius of a circle is in range [minRadius, ...
1
vote
1answer
65 views

Collision detection against complex shapes and curves

I am new in game development and for simple games bounding box collision is fine. However, let's say you have a shape or bitmap like this: This is just an example but if you had more elaborate ...
2
votes
1answer
65 views

Wall-sliding Collision Response Only Works On One Axis (2D)

"sprite" is the player object, velocity is a Vec2 that tracks movement (is set to -1, 1, or 0 at any given time), each sprite in "sprites" is a wall of the same size as the player (everyone is a block ...
1
vote
1answer
126 views

How to make an object move again after being stopped by collision in Unity?

I have a player object which position is always centered on the main camera's viewport. This object has a Rigidbody 2D, a box and circle collider. The player moves around a level, the level has a ...
0
votes
1answer
24 views

Can GJK be used with the same “direction finding method” every time?

In my deliberations on GJK (after watching http://mollyrocket.com/849) I came up with the idea that it ins not neccessary to use different methods for getting the new direction in the doSimplex ...
2
votes
1answer
69 views

AABB implementation

I have seen in some texts and tutorials on the web where an AABB is implemented as a position vector and then half-width and half-height vectors. What is the advantage in using the half-width and ...
0
votes
1answer
901 views

Simple collision detection in Unity 2D

I realise other posts exist with this topic yet none have gone into enough detail for me. I am attempting to create a 2D game in Unity using C# as my scripting language. Basically I have two objects, ...
0
votes
1answer
76 views

How could I implement 3D player collision with rotation in LWJGL?

I have a problem with my current collision implementation. Currently for player collision, I just use an AABB where I check if another AABB is in the way of the player, as shown in this code. (The ...
1
vote
1answer
83 views

Unity Problem with colliding instances of same object

I want to check if object's instance is overlapping with another instance (any spawned object with another spawned object, not necessary the same object). I'm doing this by detecting collisions ...
1
vote
3answers
192 views

What datastructure would you use for a collision-detection in a tilemap?

Currently I save those blocks in my map that could be colliding with the player in a HashMap (Vector2, Block). So the Vector2 represents the coordinates of the blog. Whenever the player moves I then ...
0
votes
1answer
110 views

How do I find the angle between two 3D angles represented in this form?

I have two 3D angles, represented by [a1,a2] [a1,a2] where the a2 is < 180. My coordinates are represented as [X,Y,Z], where X,Y,Z are 64 bit ints (longs in my lang). My direction angles are ...
0
votes
0answers
47 views

Sporadic collision detection between prefab and target?

I'm trying to get a enemy prefab to track a static target. The "enemy" is spawned into the playing area and using A* Pathfinding, tracks down the target by name. The prefab is destroyed upon collision ...
0
votes
0answers
43 views

Image layer into tile map concept

I'm not really familiar with programming but I wanted to ask if someone could give me some tips. I would like my game maps could be easily designed in some kind of graphics editor. I came with an idea ...
2
votes
1answer
113 views

How can I ensure character weapon is also included in collision detection?

I have two models, my player character and her weapon. Each can be controlled independently (that is, I allow the player to aim the weapon). The object hierarchy is: Character (with ...
0
votes
2answers
135 views

Deal Damage to Player

I have to make a simple "avalanche" game to show I know how to use the physics and creating terrain. But I actually wanted to go a little above and beyond and actually give the player health so there ...
1
vote
0answers
53 views

Pygame's sprite.collide_circle() missing several frames of head-on collision

I've spent hours trying to figure why my collision detection was so crappy, with sprites visibly ovellaping for several frames, when I noticed the culprit could be pygame's detection callback ...
2
votes
2answers
124 views

How to move towards a point in 2D, stopping at obstacles

I want to do a 2D game, where you can mouse click anywhere on the map and the player will go there. If there is obstacle in the way, the player will go as close as possible to where you clicked ...