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)

2
votes
1answer
33 views

Collision method only using one item from list

I've made a temporarily method for collision with all the blocks on the screen. (I used almost the same method in the past, but only for one block at the time.) So I start in the Sprite class. I use ...
-5
votes
2answers
180 views

Unity Renderer.bounds issue?

I would like to make rend.bounds.max.y be always equal to 20 on collision no matter what, using the script below. But it seems that I can't set it manually and the script has no effect on my ...
0
votes
1answer
34 views

2d Tile Based Collision Response

Right now I am trying to make a 2d collision response system for a platformer, and the algorithm I have for it works quite well. The only problem is that if the player is standing exactly on a tile, ...
0
votes
1answer
65 views

XNA Platformer - Where should tile collision handling be?

I've started using XNA and am working on a simple 2D platformer (single level). However, I am stuck as to where the collision detection should be handled. Here is my current project structure: The ...
0
votes
1answer
32 views

Activate and Deactivate Collider with Click

i'm having some troubles working with this, it's basically a Sword that points towards your mouse position, and when you Left-Click, a Trigger Collider is activated and then deactivated, but i can't ...
-1
votes
1answer
68 views

How to avoid mouse click over the trigger object?

I'm detecting the mouse clicks if the click is happened over the collider but i dont't want to fire mouse click if it is on the trigger object. How to i do this. Anyone give me a suggestion. Thank ...
3
votes
1answer
80 views

Get collision time between two moving, non uniform Axis Aligned bounding boxes

I have a problem finding the exact time of collision of two possibly moving or static objects. Both objects have AABB data (HalfExtents, Min, Max, Center vector and stuff) and a velocity vector. The ...
2
votes
1answer
158 views

Attach to a GameObject after collision? [duplicate]

How can I make a GameObject attach (or "stick") to another GameObject after collision? The problem: I want the GameObject to attach after collision even if it changes scale. What I have tried: ...
0
votes
1answer
70 views

Collisions between mesh (bounding-box) and Vertex/Index Buffer

I have a short Question: I'm trying to add Collisions in my 3D DirectX9 game and my World is Stored in a LPDIRECT3DVERTEXBUFFER9 and LPDIRECT3DINDEXBUFFER9 and Rendered per DrawIndexedPrimitive. My ...
0
votes
0answers
64 views

Endless sidescrolling skating spritekit game

I am developing an endless side scrolling game in spritekit. For parallax background scroll : - (void) update:(NSTimeInterval)currentTime { [self.children enumerateObjectsUsingBlock:^(SKNode * ...
3
votes
2answers
66 views

multiple contacts for SAT collision detection

I have implemented SAT algorithm for obb-obb intersection and I am able to generate a contact for this collision type. My problem is that SAT only generate ONE contact and in many situation I need ...
3
votes
1answer
109 views

Separating Axis Theorem - Calculate Normals from Points in 3D

So while researching for a method to detect collisions in a 3D space between (arbitrary rotated) boxes, I stumbled upon this excellent question with great resources for my further research and great ...
5
votes
1answer
135 views

Finding new position after collision with multiple colliders

What is the most accurate way to find the correct position to where a moving character should be re-positioned as a collision-resolution, after it has collided with multiple colliders? The figure ...
2
votes
2answers
139 views

How to make your own 2D AABB collision system in unity?

I can't use the built in unity 2d physics engine for my game, so I tried to make my own using the unity bounds.Intersects, that is working perfectly but my problem is that I don't know how to make the ...
1
vote
1answer
89 views

Libgdx: Check collisions in Stage among actors

My goal is to check collisions among the actors that are in the Stage. My question is: is it necessary to maintain a list for each type of actor I have? Doing that I get 3 problems, 2 bad design ...
2
votes
1answer
98 views

Jumping onto higher ground Collider issues

What's the general solution to the following character animation problem (I'm using Unity)? You have a character with a capsule collider and a jump animation that allows you to jump onto higher ...
1
vote
1answer
111 views

Two dimensional elastic collision of balls

I am trying to create a simple elastic collision simulation in java. (I am using some helper libs like StdRandom) Here is my Ball class : class Ball { double cx, cy; Vector velocity; ...
1
vote
2answers
89 views

Collision between complex polyominoes travelling at different velocities

My first post here if there's anything wrong please do highlight it :) First and foremost the problem I'm facing is practically identical to this earlier post here : Falling Blocks and complex shapes ...
1
vote
0answers
80 views

Character Movement and Collision with Ragdoll Rigidbodies/Colliders?

I have a player character that I'm moving with a character controller script and it is moved by applying velocity to a Ridigbody. This works when I have a rigidbody component on the player but my ...
1
vote
2answers
63 views

Wall checking not working correctly

Basically I am working on side scrolling 2d game. For that I want to check whether player is collided with wall. I have written some code for it but can't able to decide where I have done stupid ...
3
votes
3answers
234 views

OnTriggerEnter / OnTriggerStay triggers multiple times and is not been call a second time

I am working on a feature that when the Player pass thru a door, a message will popup on the screen. I'm having few problems: Debug.Log gives me from 2 to 6 logs when I pass thru the collider plane ...
2
votes
0answers
58 views

My collision detection is not working when I rotate my mesh in three.js

I am trying to move a ball mesh through a maze. The maze belongs to a parent object3d. My issue is that when I move the ball I can't detect collision right well because in the rotation, the axis ...
2
votes
1answer
177 views

My player sprite get stuck to walls while moving along

Hello, My player sprite is moving along the wall (not even diagonal, just straight down) and get randomly blocked in the corner of some walls. By blocked, I mean that the Y movement is stopped. If ...
2
votes
1answer
135 views

Efficient datastructure to store a galaxy map

I'm working on a project for an intro level Ai class, and the project I've closen is to create a simulated universe in which Ai actors play against each other economically and militarily. I have the ...
2
votes
0answers
52 views

Mouse Interaction in 3D space (ray)

I use this code public static Ray CalculateRay(Vector2 mouseLocation, Matrix view, Matrix projection, Viewport viewport) { Vector3 nearPoint = viewport.Unproject(new ...
3
votes
1answer
94 views

Finding collision point of moving projectile/bullet with a cube

I am programming a game in the spirit of Wolfenstein 3D (2D grid map, 1 cell = 1 cube) and I wanted to implement shootings. I didn't want the shootings to happen in one frame so, I wanted to see the ...
2
votes
2answers
163 views

2D Collision at corners using C# - without xna or unity

I'm trying to make collision for a 2D game, the player (car) has to collide with the walls of the track when it hits them. I looked into pixel color detection, and X,Y -based collision (But since its ...
1
vote
0answers
44 views

GJK algorithm in case of circle and polygon?

I wonder if it's possible to modify GJK so I can use it to detect collision between circle and n points polygon. I implemented for polygon and polygon before, and I tried modifying the support ...
3
votes
1answer
55 views

Matching collider to character mesh size in different postures

What's the optimal method in Unity to match the size of a Capsule Collider to the actual size of the game object it is part of? To understand what I'm trying to do let me give an example: I have a ...
2
votes
1answer
140 views

Detect walking on floor - works partially

I have a set of Gameobject blocks that form a floor with Box Collider and a GameObject with a Box Collider in it. My first hunch detecting hitting the floor was: void OnCollisionEnter2D(Collision2D ...
8
votes
4answers
659 views

How do I efficiently check if a point is inside a rotated rectangle?

Part for the sake of optimization, part for learning purposes, I will dare to ask: How can I most efficiently check whether a 2D point P is inside a 2D rotated rectangle XYZW, using C# or C++? ...
5
votes
2answers
139 views

Collision detection with moving objects

I searched a lot about this problem. I found many answers here in Stack Exchange but none of them really answers when positions for objects get updated. For a game with fixed size map and that has ...
1
vote
0answers
68 views

XNA Collision In An Entity Part System

I've hit a loss in creating a "game engine" in XNA, I'm extremely confused over how to approach collision in an Entity-Part System ( following this as a reference ). I can make all the entities with a ...
4
votes
2answers
64 views

2D Collision Box Clipping

There is this strange issue with the collision in a game I am making. When the player is slightly lower than a block it is colliding with from the side, the player ends up clipping to the top of the ...
0
votes
1answer
154 views

Detecting collision with walls (is this a good solution?)

I'm trying to make the collision smooth (it must open the animation, but not move the character). I've implemented 'fake positions': int step = 20; fake_left_x = x-step; fake_right_x = x+step; ...
2
votes
0answers
44 views

What is the most efficient way to determine collision path

I am trying to create a game in which I need to know if two objects will collide in the future, and when. I have both object's position, radius (they are circles) and velocity. A specific example of ...
1
vote
1answer
252 views

Platformer collision problems

I am working on a platformer 2D, and i am currently focusing on collision. I have the actual rectangle(class: Rect) and i can detect if the player-model is intersepting it. However, when it comes from ...
2
votes
2answers
117 views

Most efficient way to get the world position of the 8 vertexes of a Box Collider (C#)

What I am looking for is the most efficient way to get the world position of the 8 vertexes of the Box Collider of a freely rotated Gameobject. I cannot use collider.bounds since object is rotated, ...
1
vote
0answers
41 views

Detecting the two Vector3 that determine the bottom-edge of the side of a box-collider that had collision (with C#)

So, I understand that plenty of questions have been posted on how to detect which side of a Box Collider had collision. However, what I am trying to achieve is a little different. I want to find out, ...
11
votes
2answers
204 views

Combining Many Small Colliders into Larger Ones

I am creating a game using a tile-map made of many thousands of grid squares. At the moment, each square has a square collider on it for checking collisions. However, with many thousands of tiny ...
3
votes
1answer
178 views

How can I exploit multithreading in collision resolution?

I'm trying to speed up my collision resolution by using multiple threads. I'v read through Box2D's source code and while it was challenging and educating, it didn't really point me to how I could use ...
1
vote
1answer
147 views

Ray & Segment Intersection

I'm writing some code to check intersection between all of a rectangles segments and a ray. It will sometimes use the Left and Right side of the rectangle as the closest face hit (face DA & BC) ...
0
votes
0answers
26 views

JBox2D Collision Detection

how can i detect a collision between two fillOval with the physics engin?? i read the manual but i can't understand where i may write my code. i want to simulate the fall of 2 balls and catch the ...
1
vote
0answers
578 views

Colliding without physics in Unity: is it possible to put OnTriggerEnter in the moving character?

My main question is: is it possible to put OnTriggerEnter in a script that goes attached to the moving character instead of to trigger area/object? Let me explain my exact need. I want to detect the ...
2
votes
1answer
189 views

How do I check for collision between an ellipse and a rectangle?

I am working on LibGdx framework for developing a 2D isometric tower defense game.All my sprites are drawn in 2D isometric view. I have used an array list to store 8 points at boundary in the ...
7
votes
2answers
227 views

How do I create a draggable object which snaps to obstacles in the way?

I bring yet-another-drag-with-mouse question (I am using Unity with C#), but with a less common particular detail: the existence of obstacles in the middle of the way trough which dragging occurs (3D ...
1
vote
1answer
74 views

My Sprite is disappearing when it collides with my floor (libGDX)

I am just starting to build the game "engine" and I am using a sprite drawn in the same position as a rectangle and the two always move together. I have another rectangle which is the floor when the ...
1
vote
1answer
52 views

Spawning Object 1 Within Object 2's Collision Box [Gamemaker]

I was wondering if any of you could help me with a specific Gamemaker question. Am using Gamemaker Studio. I have an object (oSpecialSolid) which rotates and moves across my level. At random ...
1
vote
1answer
109 views

Player Flying after colliding - Unity

I have a Player with a capsule collider on him and i have various objects in the scene. Most of the objects have either mesh collider or box collider enabled. When i move my player and the player ...
4
votes
1answer
139 views

Circle inside ellipse collision/intersection (preventing circle from leaving the ellipse)

I am working on a 2D RPG with a turned based battle system. Characters move inside the confines of an ellipse movement area and when they leave the boundaries will be pushed back inside. (i.e they ...