Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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

0
votes
2answers
45 views

Advanced Tetris Programming

This example of tetris game is more complex than general clones. [to test the link: enter/ctrl for start and c/v/b for movements] As you see from the game it has: Smooth movement Auto alignment of ...
0
votes
1answer
25 views

How to collision Ball in Game Maker 2 (Drag and Drop)

Hey There I'm using Game Maker 2 Drag and Drop project, I make some Game like Break Out and when the ball collision with the wall he doesn't Bounce, in game maker 1 we have ( Bounce Action) but in 2 ...
1
vote
1answer
110 views

How to allow to slide rectangle to not colliding with corners between two rectagles?

I am detecting each side of collision between two rectangles, and wen I collide them, lets say, with the left side, it also detects collision on the top side when I move to the top, and the downside ...
0
votes
1answer
35 views

How to use seperating axis theorem to allow for sliding along walls

I'm making a 2d platformer game and using the separating axis theorem for collision detection, but i want the player to be able to walk along the ground and slide on walls and other stuff and i can't ...
1
vote
0answers
16 views

How to determine angle of incidence, resulting position, and resulting velocity for a point with position and velocity appearing within a rectangle?

I have a rectangle positioned on a 2D Cartesian coordinate system, and its minimum x and minimum y are represented as a coordinate pair (xrect, ...
0
votes
0answers
23 views

Alternative to a collider for representing a horizontal plane

I'm studying with Unity, and now I'm starting to learn stuff without using the pre-implemented components like colliders etc.. Right now I have my player walking on a plane using the following code: ...
0
votes
0answers
9 views

How do I rotate the child object of a rigidbody? [duplicate]

Suppose I have a game object with Rigidbody component attached. I then create a child object below it. parent->child How do I rotate this child object relative ...
0
votes
1answer
63 views

Collision detection in 2D games

I am making a basic 2D platformer. I want to get the relative position of one rectangle to another. This is how I do it right now: ...
0
votes
0answers
16 views

How can I detect the collision between the ball and the paddles?

Let's say I have 2 objects that can move but if they where to touch each other then a popup or something happens. ...
0
votes
0answers
23 views

How do I apply rotations to parent child using Rigidbody? [duplicate]

I have a finger object. It is just three cubes representing the finger parts. The 2nd cube is the child of the 1st one. And the 3rd cube is the child of the 2nd one. This is the heirarchy: ...
0
votes
0answers
12 views

RaycastHit2D collision detection problem?

I want to add a ray to the mouse position and detect the objects with this ray. I made it but there is a problem: ray doesnt collide with objects sometimes. the code: ...
-1
votes
0answers
28 views

Unity LineRenderer Edge Collider detection problem?

I am working on a line if touch screen it will be drawen and edgecollider2d will attach with it. I made it but there is a problem. I want the edgecollider2d to detect with other objects colliders. ...
0
votes
1answer
52 views

Most efficient way to check collision

For example, I have a player and a map, to check player collision with some block we need to check entire map tiles, but the bigger the map, the slower the framerate. What's most efficient way to ...
-1
votes
1answer
29 views

trying to work out coords based collision [closed]

In this game I'm working on, both player and enemies are represented by 32x32 sprites(not using bounding boxes). I'm trying to make a system where if the x and y coordinates of the player and ...
1
vote
1answer
35 views

Splice enemy array to destroy enemy (js game)

I am currently working on a basic space invaders game. So far I have created the enemies, a main character, and a laser beam, collision detection between enemy and bullet, however when my bullet ...
0
votes
0answers
5 views

Sat.JS finding the collision vertex

I am making a simulation in Javascript. I am using Sat.js. I have polygons in the simulation such as triangles and squares (these float around rotating) and 'laser beams'. The laser beams are just ...
0
votes
1answer
41 views

Separating axis theorem OBB vs Sphere

I am trying to implement collision detection in 3D between OBB/AABB and sphere. For this i'm using sat/separating axis theorem. For sat to work in 3D i need face normals of obb (sphere to face), each ...
0
votes
0answers
18 views

Colliders going through each other

I'm trying to trap objects inside a room (a hollow 3d object), here's what I have: A 3D object with a mesh collider (not convex) on the inside and a bouncy physics material randomly generated ...
1
vote
0answers
8 views

Affect of timeStep on PhysicsBodies in SceneKit

In SceneKit, I had a problem on collision of two dynamic spheres, when the one strikes to another with fast speed, it was passing through inside of it. After i have reduced physicsWorld.timeStep value ...
0
votes
1answer
70 views

Why is my spherecast returning an incorrect hit on mesh collider? (Unity)

I have a mesh collider that is largely a flat plane facing up. Any SphereCast against that surface should return a normal of Vector3(0, 1, 0), but that isn't always happening. When near an edge on the ...
0
votes
0answers
45 views

Efficient collision detection between triangle and circle

Recently I've been making a game (A bit like Asteroids), and I've come to a point where I need an efficient algorithm for detecting collision between a triangle and a circle. I've checked google, ...
0
votes
0answers
18 views

Polygon vs polyline collision boundaries

I'm making a 2d, point and click, side scroller game and I'd like to limit the playable area. I've created a simple level editor that allows me to place sprites on the map and now I need to decide how ...
0
votes
0answers
14 views
0
votes
1answer
20 views

How to know the point of collision with another object in Unity5

I have a small problem and it would be very helpful, which could guide me. What happens is the following, I have an enemy (evil usb) in my scene, to the collisionar this enemy with my main player ...
0
votes
0answers
25 views

Preventing a rectangle from moving through obstacles

I have written some code in a python pygame module which can move a rectangle around the display. Now I am planning to put some obstacles that should block the rectangle, but the rectangle still ...
0
votes
1answer
34 views

Handling exact collisions on character controller and/or other objects in unity? (eg. head shot, chest , leg,etc)

Hello all I have been working on games in Unity for a long while (making slow progress as I do it purely on my own , and of course you helpful people here on gamedev.stackexchange!) I've made lots of ...
0
votes
1answer
61 views

AABB test does not consistently detect edge-to-edge contact when bounds are very different in size

My function compares two AABBs for collision detection, and when they are around the same size it works fine, but I noticed that if I greatly decreased the size of one of them (or augmented the size ...
1
vote
2answers
57 views

Collision and changing the scene. C#

I'm running into a problem where I want to create some code that such that if an object (Cube) is destroyed, it to changes to another scene. Here is my code: ...
0
votes
0answers
36 views

Top-down perspective movement/collision

I have been trying to get my top-down collision code/movement system to work the way I want it to: I would like the character to be able to move forward, backwards, left and right, all while being ...
0
votes
1answer
26 views

libgdx - Problem occurring after collision detected

I have just implemented collision detection in my little 2d rpg-like game. I'm using Tiled for the maps, mechanism is simple - I have one layer called 'collision' in my tiled map, and while loading ...
0
votes
0answers
18 views

box2d get velocity with which the body collide

I need to know with which velocity an object collide to test if the body is destroyed. For example, if a vase collide and getLinearVelocity() > 10 the vase will ...
0
votes
1answer
19 views

How to implement level-player collisions resolution?

I want to create simple collision response system (physical simulation is not required now). It is needed just that player can't go through walls. I consider some variants: - Just create a set of ...
1
vote
1answer
59 views

How do Axis-Aligned Bounding Boxes update with rotations?

I have a bounding box class with a min (x,y,z) and max point (x,y,z). The object that is being rotated has a rotation matrix (3x3 matrix), but I don't know how to update the bounding box with ...
0
votes
1answer
147 views

How to Design a Generic Collision Detection System?

I'm designing a C++ 2D collision module, and I ran into a problem designing a system where the collider is unaware of the shape it's colliding against. I'd like to have a abstract base class called ...
0
votes
0answers
43 views

Physics.IgnoreCollision not working right after invoked

When invoking Physics.IgnoreCollision in Unity, it seems work but it still have collision detection right after creation. I have this issue with ejecting empty case after gun fire, it's spawning ...
2
votes
0answers
30 views

How do you find the collision between 3D boxes and 3D QUAD face meshes?

I have an axis aligned bounding boxes for 3D object collision, but I have a complex 3d mesh that's divided into 3d faces so I want to check for bounding boxes and collision with the faces of that ...
0
votes
1answer
70 views

How can i collide two bodies without filtering(collision filtering)?

I have two bodies with fixtures. One is platform or ground and other is the player itself.I want to collide the player to the platform without bit filtering.How can i do that?I can see the rectangular ...
0
votes
0answers
22 views

psuedo-3d collision in Unity

I'm recreating the movement system from the DS game Dragon Quest Heroes Rocket Slime. In the game, the player controls a slime that can stretch himself and blast in the direction he was stretching. ...
0
votes
1answer
110 views

Unity: Water shader vertex offset - how to add mesh collider which updates with vertex offset?

I have written a shader (in the new LWRP shader graph) which simulates an ocean with vertices which offset to create a moving "waves" effect. I believe that in order to have objects "float" on my ...
0
votes
1answer
25 views

How do you create hitboxes that will detect stationary targets too?

I've created a basic attack combo system that chains 3 attacks together. When the player clicks the mouse button, it enables a boxCollider2D attached to the player. The boxCollider is a trigger and ...
0
votes
0answers
46 views

Detecting collisions without rigidbody

I have a car with the following aspect: As you can see, colliders are locally static, because they are separated from the original rigidbody component. Well, as you can suppose, I have a problem, ...
0
votes
1answer
36 views

Does destroying body also destroys the sprite?

Suppose a sprite is attached to a box2d body. And world.destroyBody(b); is getting called then the sprite also get destroyed or it stays there in memory. In my ...
0
votes
0answers
27 views

Object moving by adding force to Rigidbody bouncing off where ground objects met

I have a object that moving by adding force to rigidbody. With just big flat plane, it works fine but with connected small planes, sometimes(actually not sometimes, a lot) the object bouncing off or ...
2
votes
0answers
120 views

Getting false positives with SAT

I've been trying to get proper collision detection with SAT in 3D. I started of with this post: How many and which axes to use for 3D OBB collision with SAT. I've been trying to get the right axis to ...
0
votes
0answers
18 views

Predicting collision angle between polygons

I have a collection of polygons that each is constituted by a collection of vertices and edges. All edges on the polygon are of unit length and thus edges only connect consecutive vertices. Edges on ...
1
vote
0answers
17 views

VRTK ignores IsTrigger

VRTK allow collision detection by adding the VRTK_HeadsetCollision, VRTK_BodyPhysics, VRTK_HeadsetFade and VRTK_HeadsetCollisionFade scripts into Unity. This works so that in VR when I walk through a ...
0
votes
0answers
61 views

Cache friendliness of AABB-Tree: binary vs N>2

I found that state-of-the-art physics engines like Bullet and Box2D all use binary AABB-Tree for broad-phase collision detection. I wonder, did anybody tested AABB-tree with >2 branches per node ? ...
0
votes
0answers
40 views

Unity 2D: Pixel-for-Pixel Collision

I'm making a 2D game which features a pixelated landscape. The landscape is quite large, meaning I do not want to use an edge collider to draw out the terrain manually. Is there a script/collider that ...
0
votes
1answer
41 views

2D Per Pixel Collision Detection using Animated Sprite

I am using MonoGame 3.6 and Visual Studio 2017. I have been trying to find a solution online to do per pixel collision detection using an animated sprite that I am drawing from a sprite sheet. Using ...
0
votes
3answers
229 views

How to optimize collisions

I'm building a 2D MORPG using JavaScript, Node JS and socket.io To prevent cheating, I have to run all collisions for all players on my server. I'm currently doing fairly simple square collisions ...