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
48 views

Javascript, how to make player collide with tile map

I'm trying to do a bomberman based game, but I'm struggling to make the player colide with the wall, here's my code below: Inside of the array, 0 is the walls and 1 is the path // xPos is the ...
0
votes
1answer
36 views

Values or Struct-Like Location Class?

I'm currently working on a 2D RPG, where the player character moves on a tilemap but is not constrained to the individual tiles. Every tile in a room is referred to by x and y coordinates to an Array. ...
-3
votes
2answers
48 views

How to make an OnCollision reset level script?

I am making a game and I want to make a script that if a player collides with the resetting object the scene will reset/reload.
0
votes
1answer
28 views

Raycasting against my plane does not detect collisions in Unity

I'm trying to keep the camera above a plane which acts as the ground, so I wrote this bit of code: RaycastHit hit; if (!Physics.Raycast (transform.position, new Vector3 (0, -50, 0), out hit, 5)) { ...
2
votes
1answer
56 views

Terrain Collision problem

I'm trying to implement terrain collision for my height map terrain, and I'm following this. The tutorial is for java but I'm using C++, though the principles are the same so it shouldn't be a problem....
1
vote
2answers
45 views

Unity2D - collide with objects while moving to a position

How do I get my character to collide with other objects while moving to a position? All I've managed to do is change the position, it only collides if the character is not moving, it's like he is ...
0
votes
0answers
12 views

RoBlox: Leaderboards Incramenting with a kill by gun

I'm New to Lua but I could not figure out how to detect that the bullet did the final blow and trace that back to the player and within script access the leaderboard script and add 1 to KO section of ...
1
vote
0answers
19 views

Allowing one sprite to move through another in Quintus

I have a Bumper class extended from Sprite: Q.Sprite.extend("Bumper", { init: function(p) { this._super(p, {gravity: 0}); this.add("2d, ... //etc. } I have an Enemy class that ...
1
vote
1answer
68 views

Tile Based Collision With Moving Platforms

I am developing a platformer using pure HTML/Javascript. After remaking my collision detection system with help from HTML5 platformer collision detection problem, I realized my moving platform ...
1
vote
1answer
29 views

Technique to find a mesh intersecting with a primitive solid without using colliders?

For what it's worth I'm using Unity3d, but I believe the problem is more general. There are hundreds if not thousands of meshes with hundreds of vertices each. There is one sphere that can be ...
1
vote
0answers
32 views

Triggers are not detecting colliders from other game objects in Unity version 5.2.2f1? [closed]

I was working on a basic slots game, and I came across a hiccup with the 2D Physics engine. Currently I'm letting the reels spin for three seconds. Once it has finished spinning, it will go to the ...
3
votes
1answer
107 views

Is it sensible to make all physics on GPU using transform feedback?

I'm learning OpenGL and today I read something new to me. It's called transform feedback, and if I understand right, it can help to get information about vertex shader variables. And I read an example ...
1
vote
0answers
66 views

Polygon 2D collision response- How do I find the correct edge a polygon hit?

Hey guys I've been seriously stressed out by this, so please go easy on me. My goal is to reflect a bullet (polygon) off of another polygon, and find the edge the another polygon, A (the bullet), hit....
1
vote
0answers
12 views

LibGDX Compare color of Box2D objects on collision

I have two red balls and two yellow balls, which were created from a class Ball. The balls are box2d circles, with sprites attached. Is there a way in which I can check to see if two balls have ...
1
vote
1answer
49 views

What's a way to improve this wall collision detection code to keep objects within a perimeter made of these walls

// Player Collides with Wall counter1 = 0; for (iter60 = wallArray.begin(); iter60 != wallArray.end(); iter60++) { if (Player1.rect.getGlobalBounds().intersects(...
1
vote
0answers
25 views

Test for Box2D collisions between object being dragged and other objects

Goal: I am writing a prototype which has as many as 50 (Box2D) colored balls on the screen. I can drag any ball, and what I need to do is test whether the dragging ball has touched a ball of the same ...
2
votes
2answers
32 views

How to access a prefab's boolean property through collision (with the same Prefab but different Instance)?

I am a trying to recreate the first stage of Super Mario Brothers, but I am having a bit of trouble with the collision system between Koopa Shells. I have written two different scripts in hopes to ...
4
votes
1answer
126 views

How can I handle fighting game collisions for complex animations?

Imagine that I have an animation like this. As you can see, this attack hits in three horizontal places. The opponent facing this player could be hit mid and low (standing or crouching). The same ...
-2
votes
1answer
36 views

Polygon movement towards certain point libGDX

I recently started using the Polygons but I'm have struggle as I'm trying to make a Polygon move towards the center of my screen, although I don't know how. Here's the code I have(What I'm trying to ...
0
votes
0answers
39 views

UE4: Multiplayer Projectile Hit Detection Problem

I'm trying to do Projectile Hit detection in multiplayer game. I'm using next approach: On the server side I'm storing all character's positions with world timestamp(PositionUpdated method). When ...
1
vote
1answer
22 views

Custom Tile Collision Detection Has Trouble With Edges

So, I'm writing my own game to expand on my abilities as a programmer. However, I have come to a writer's-block of sorts. The game I am building uses tile collision, but allows the player to be in an ...
1
vote
0answers
41 views

Collision Detection between two instances of the same Prefab

I am a trying to recreate the first stage of Super Mario Brothers, but I am having a bit of trouble with the collision system between Koopa Shells. I have written two different scripts in hopes to ...
0
votes
0answers
21 views

Making different collision mask for separate frames in GameMaker

I've been using Game Maker for a while as a beginner but as I tried to do harder things I was faced with a huge problem, I was trying to make a part of my game where the character goes through moving ...
1
vote
1answer
69 views

given the position and velocity of an object how can I detect possible Collision?

I'm trying to detect Collision between autonomous moving objects and steer direction if collision is detected. so far I've been following a tutorial and I'm having a hard time to fully understand how ...
1
vote
3answers
64 views

BoxCollider2D Not Working

So I'm making a copy of noobtuts tutorial on Snake - http://noobtuts.com/unity/2d-snake-game I've done all their steps and am at the point of extending the game solo, however I've an issue with the ...
1
vote
1answer
30 views

IgnoreCollision while Dodging & Colliding

I'm working on a mechanic to allow the player to dodge through enemies. However I'm running into the issue where the player is only able to dodge through enemies while their already dodging when they ...
1
vote
1answer
26 views

Can't make sprite collide with tilemap made with Tiled

I'm a newbie who just started learning phaser. I have created a tile map with Tiled. It is composed of two tiled layer: background & collision. In collision layer I put some walls. And in the ...
1
vote
0answers
61 views

How to implement A* pathfinding for enemies to follow player

The enemies in my game are supposed to follow the player in order to cause damage to it. Right now I have it where the enemy just goes in the direction that will bring it closer to the player, and ...
1
vote
1answer
31 views

Rotated Sprites collision detection

I am trying to implement checkCollision function in my game, I used AABB method but the problem is that my sprites are rotated so it's not really precise. I could finely describe my Sprites with ...
1
vote
0answers
5 views

Detecting collision between browser window middle point and other sprites visible in the window

In HTML5 canvas, I have an object which is always in the middle point. On the big map there are other moving objects. I want to detect if the middle point of the window hit any shape we see on the ...
1
vote
0answers
24 views

Retreive 3d World Map coordinates from touch/click input with LIBGDX?

Problem: I am trying to create an RTS style interaction. I want to be able to click on the map and have characters move to the click location. I haven't been able to figure this out, even after ...
1
vote
1answer
24 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
167 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 ...
2
votes
0answers
23 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
102 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
4answers
98 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 ...
1
vote
1answer
61 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 ...
1
vote
0answers
45 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
2answers
68 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(...
1
vote
0answers
40 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 ...
1
vote
2answers
64 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 ...
0
votes
0answers
28 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 ...
0
votes
1answer
30 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 ...
0
votes
0answers
37 views

Detecting collision of multiple moving objects

I have wrote a simple game that has a 100 balls bouncing off the borders of the canvas. Each ball is an instance of ball class function that has the following definition: var cnv = document....
0
votes
1answer
74 views

Should I check all the collisions in the game world?? - 2D game

I'm developing a 2D game engine and right now I'm designing the collision system. I've read about space partitioning and QuadTree, and I understand that only the objects that are in the user's view ...
0
votes
0answers
49 views

Online Enemy Hit Registration methods

Basically I have been working on an online game for quite awhile now, and I have started rewriting the original networking framework. Before it was pretty much fully Dead Reckon based(Enemies just ...
1
vote
1answer
28 views

Changing speed of an object

Is there a way of changing speed of an object at certain time? I want to change my speed to my initial speed after colliding with any object. I have already added bounce Physics to my colliding ...
0
votes
1answer
19 views

Maintain speed, in 3D game, after collision in Unity

I am making a simple breakout game. I have added bounce physics to the ball and to the bricks. When the ball collides with the bricks, the speed of ball slows down. I want ball to maintain its speed ...
0
votes
1answer
105 views

How to achieve 2D ski movements similar to Alto Adventure?

I'm trying to achieve 2d movement similar to Alto's Adventure with Unity 2D. When grounded I want the character to slide alone the terrain parallel to the slope, but I want to be able to freely rotate ...
0
votes
0answers
53 views

Collision detection not working for JavaScript Game

I'm working on a JavaScript game called Spacecraft which is minecraft 2d style. The problem is that my collision detection is not working. It works for a all the divs but the ones with the class of ...