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)

0
votes
1answer
33 views

Collision causing FPC to go haywire

I have created a first person controller as an enemy in my game (Zombie). My character is an archer that uses arrows as projectiles that are shot with the following code: if(Input.GetButton("Fire1")) ...
0
votes
1answer
9 views

Raycast will not hit generated box colliders at initialization

In my map class I have an algorithm that is generating and merging box colliders together. These belong to the layer "Ground". After that, in some places on my map I'm generating some new cubes on-...
1
vote
4answers
124 views

What would be an efficient way to check if there is a collision in a 2d game?

As part of my final project of Algorithms and Data Structures, we have to develop an open world game in C++. I already got developed most of the game, but I haven't coded the collisions with the ...
3
votes
1answer
282 views

Determine wheter an octree node needs to be continue

For collision detection (moving vs. non-moving) in my current project, I decided to implement an octree approach after the preselection. The only collision detection I'm currently using is a AABB-vs.-...
1
vote
1answer
99 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 ...
5
votes
2answers
865 views

Space-efficient data structures for broad-phase collision detection

As far as I know, these are three types of data structures that can be used for collision detection broadphase: Unsorted arrays: Check every object againist every object - O(n^2) time; O(log n) ...
1
vote
1answer
123 views

Frustum culling takes ages c++

I have two ways of doing frustum culling taken from different web sources. First one takes 200ms to check 10k AABBs, second around 50ms for the same box count. I read some forum answers, people say 0....
2
votes
0answers
22 views

What is the formula for the collision of two “stretched spheres”?

In Smash Bros Melee, hitboxes aren't perfect spheres or boxes. They are, instead, a shape that looks like a continuous line of consecutive spheres: I.e., the geometry can represented as: Hitbox :...
2
votes
1answer
158 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 ...
1
vote
4answers
89 views

How can I determine which Trigger is hit?

I have a GameObject. It has 3 BoxCollider2Ds: Body Collider - Not a trigger - Determines if body is hit Weapon Collider - Trigger - Determines if weapon is hit Vision Collider - Trigger - Determines ...
2
votes
3answers
360 views

Adding a small slide when player releases left/right key

The aim is for the player object to slow down and stop instead of just stopping dead. The following codes works ok when the player is not jumping, but gets stuck in an object if the player is in the ...
0
votes
3answers
2k views

Find closest point on NavMesh if current target unreachable

I have a mock environment set up with a cube that has a specified "Not Walkable" layer. I'm using NavMeshAgent and NavMeshPath to set destinations of the player. The way I'm setting paths is by ray-...
2
votes
1answer
67 views

How to code a multi level isometric map?

I have already worked with isometric grids in the past, but in my current project I found an issue I am not sure on how to solve. I am trying to produce something similar to what's in the below screen:...
1
vote
1answer
50 views

Detect Collision on Child Object

I've created an obstacle prefab. The Prefab has following hierarchy. The player must die if he collides with Enemy. But It detects collision with parent object. I am also uploading the screen shot ...
0
votes
1answer
62 views

Player collision with object

so I have an fps controller, and I want to change camera when it collides with a box collider. I think I did it properly but it didn't work. Here's my code. using UnityEngine; using System....
1
vote
2answers
55 views

LibGDX - Collision detection between all bullets and all enemies

I'm trying to make a collision detection system between the player's bullets and all the enemies on screen. So far I had something like this: for (Bullet bullet : hero.getPistols().getAllShotBullets(...
0
votes
1answer
667 views

Game object position issue in unity3d

I have a set of objects placed on the same layer where all the objects are invisible except one. When I drag an object into a selected area, the current dragged object gets destroyed, and the object ...
1
vote
1answer
83 views

Targeting logic for 100.000 units army

I am making an army fight for my website armyfight. There can be fights of hundreds of thousands units. I am looking for better unit targeting. in jsfiddle is an example. var enemy = { 2: { ...
0
votes
1answer
37 views

onTriggerEnter(Collider obj) is not invoked on collision with a trigger or a rigidbody

void onTriggerEnter(Collider other){ if (other.gameObject.CompareTag("Pick Up")) { other.gameObject.SetActive(false); count = count + 1; setCountText (); } This is ...
3
votes
3answers
402 views

Fastest 3D bounding box algorithm

I am at the point in my game where I need to add a collision system. I tried jBullet, and while it did work, it wasn't what I was looking for. I just want a simple way to test if two oriented bounding ...
0
votes
1answer
98 views

How to handle collision detection

So the way that I am doing the movement for my game is that you can left click a unit (which is just a rectangle object), and then it is selected. While it is selected, you can right click and that ...
0
votes
1answer
47 views

Check collision between two rectangles - libGDX

I'm making a game in which the objective is to collect the maximum amount of balls(Rectangle) to get the highest score. The balls spawn randomly from the middle of every side of your smartphone, and ...
2
votes
1answer
611 views

Using PhysX, how can I predict where I will need to generate procedural terrain collision shapes?

In this situation, I have terrain height values I generate procedurally. For rendering, I use the camera's position to generate an appropriate sized height map. For collision, however, I need to have ...
1
vote
0answers
38 views

When to Use Spatial Hashing vs Bounding Volume Hierarchy?

I've been slowly working on implementing a spatial hashing function into Bullet Physics to see how well it will work in my game engine as a general use. Though as I'm starting to design it, I do ...
1
vote
1answer
268 views

LibGDX - Tilemap Wall Collision Detection Issues

I cribbed some code from another web tutorial (SuperKoalio - https://github.com/libgdx/libgdx/blob/master/tests/gdx-tests/src/com/badlogic/gdx/tests/superkoalio/SuperKoalio.java) about detecting a ...
0
votes
1answer
506 views

3d Wall sliding collision

I'm working on collision for walls in my game and the way I currently have it I get stuck walking into a wall. I'm trying to make my character slide on the walls but still collide. My character moves ...
1
vote
0answers
37 views

How to manage collision of two player ?

I'm developing a multi-player car game. Suppose that car A hit car B: both A and B have Rigidbody and collision functions attached. Because car A hit car B i want to take actions only to car A (add ...
0
votes
1answer
33 views

Pygame: Collision detection

i've been adding some extra stuff like Gravity and a table to a simple pong game made with Pygame and Python, the problem is that i dont know how to add collision detection, so when the ball hits the ...
1
vote
1answer
709 views

Swinging a sword in Xcode with Sprite Kit

I'm working on making an RPG in Xcode, and I'm having a major gameplay issue when it comes to having my character swing his sword in a way that is realistic and gameplay compatible. Right now, when ...
0
votes
1answer
114 views

Slow collision detection at low frame rates

I'm experiencing an odd issue with my collision detection. I'm using the Update method to move the player (I don't want to use FixedUpdate because that creates an undesired weird movement). The fixed ...
0
votes
1answer
51 views

Bouncing from any object after collision JavaScript

I'm trying to make a ball bounce off some obstacles after a bounding box + pixel by pixel collision. Somehow, sometimes the ball is not going in the direction it is supposed to be. If the ball is ...
2
votes
1answer
128 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 ...
0
votes
1answer
150 views

Moving a Polygon based on Camera position

I am in the process of implementing TMX Maps (made in Tiled) for my game. In Tiled, I can create polygons, which leaves a tag, containing the points. Loading in these points to a Polygon (java.awt....
1
vote
1answer
77 views

Color Based Collision Javascript (Cocos2d-js)

Im looking to make an isometric game...so my partner designed the isometric map (jpg image) along with the map objects (png) on adobe ilustrator... so the thing is i would like to set the player path ...
0
votes
0answers
24 views

How can object push each other / bounce with swept AABB / continuous detection?

I'm making a small 2d rigidbody physics engine. All objects are AABB (the engine doesn't handle rotation). Currently, the detection system work with a swept AABB test and can determine the time of ...
4
votes
2answers
302 views

How to impale and stack targets correctly according to the collider and its coordinate?

I'm making another simple game, a catch game, where a spawning target game object must be captured using a skewer to impale it. Here how: At the start, the falling object (in red) will fall in a ...
3
votes
2answers
416 views

Sprite Kit - containsPoint for SKPhysicsBody?

I have a ball bouncing around the screen. I can pick it up and drag it onto a "bucket". When my touches finish, I use the containsPoint function to check and see if I have dropped the ball onto the ...
1
vote
1answer
128 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 ...
0
votes
1answer
144 views

Is the standard collision detection in Slick2D too heavy for broadphase?

I was wondering two things about the built in shape detection of Slick2D. When executed on a lot of shapes, how performant are the intersects and containsmethods, and what kind of algorithm is behind ...
0
votes
2answers
28 views

Moving towards and switching targets in Unity with collision

I have these nodes set up for a ship to move towards over time with out looking stops then repeats in a sequence. like so: 1 2 3 1 2 3 1 2... THE PROBLEMS i keep having either come from the ...
0
votes
1answer
191 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 ...
3
votes
2answers
490 views

Collision detection between draggable object and world objects?

I have a game I'm making in Javascript that will involve combining items by dragging and dropping them onto each other. Think Alchemy or similar. So far, so good, but I hit a snag while trying to ...
1
vote
2answers
140 views

XNA 4.0 - Bounding Boxes

So i'm kind of new to programming and im trying to check collision using bounding boxes. i'm currently stuck as to how to call my bounding box within my bounding box function as shown below public ...
1
vote
1answer
127 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; ...
0
votes
2answers
636 views

3D collision physics. Response when hitting wall, floor or roof

I am having problem with the most basic physic response when the player collide with static wall, floor or roof. I have a simple 3D maze, true means solid while false means air: bool bMap[100][100][...
1
vote
2answers
44 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 ...
0
votes
1answer
146 views

How to retrieve vertex information from ID3DXMesh

I need to know the position of each vertex (and triangles) from a mesh (a pointer to ID3DXMesh, created by calling functions like D3DXCreateBox, D3DXCreateTeapot and D3DXCreateSphere) to perform some ...
0
votes
1answer
23 views

Disabling object OnCollisionEnter and Enabling it On Collision exit

I have two objects that when they collide disable another gameobject. The problem is that I only want to have the other game object disabled while the two objects are touching and that I want to have ...
1
vote
1answer
178 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
1answer
87 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 ...