Stack Exchange Network

Stack Exchange network consists of 175 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

Questions tagged [collision-detection]

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

1
vote
1answer
35 views

Why do my NPC`s fall through the world when I select them as triggers

So im making a game in Unity where when the player comes into contact with an NPC it will switch scenes. I have the code for it and made sure all NPC`s have rigidbody as well as using gravity and ...
0
votes
1answer
48 views

How would I move something around inside of a sphere without it going outside of the sphere?

I want to be able to do this, but not go outside of the 4.4 meter limit, the radius is 4.4 meters, and it has zero gravity and no friction. I have a hard time explaining this, but imagine holding a ...
0
votes
1answer
24 views

Unity Proximity Warning System Trigger issues

I'm trying to set up a proximity warning system but I'm having some trouble. To simplify things as much as possible: I have two game objects in a scene (Object1 and Object2). Object1 has a large ...
0
votes
0answers
28 views

How to check collisions between rotated rectangle and a straight line?

How do I detect collisions between a rotated rectangle and a straight line?
4
votes
3answers
60 views

Collision detection in Arkanoid-like game at intersections

I'm creating an Arkanoid-like game from scratch. I have no (formal or informal) education of any kind in game-development, so I kinda made up things as I went regarding collision detection based on ...
1
vote
0answers
15 views

How to differentiate between colliding objects in Box2D?

I need to differentiate between different points of contact in my racing game. I currently have staticSensors which determine if the car is on the track or not, but I have created a second sensor to ...
2
votes
0answers
29 views

Support function of Minkowski Difference

I am watching this and if you stop at 7:25, you will find an implementation of the support function. The goal of the function is to give you the farthest point in a given direction. My question is how ...
2
votes
0answers
14 views

Unity - kinematic rigidbody character calling OnCollisionEnter and OnCollsionExit on every frame for specific collisions

I'm encountering an issue with my character collider behavior. I have several elements that are relevant to this issue: a "character" gameobject (capsule mesh), that is assigned with a kinematic ...
0
votes
0answers
28 views

2D AABB Swept Collision Algorithm Premature Collision

I've been following this pseudo code for my implementation of 2D AABB Swept Collision: ...
0
votes
2answers
48 views

Calculating the intersection of a fast moving circle and a line

Inside of my game, I am in need of a way to test the collision between a line segment and a fast-moving circle. I would say I need a line v capsule collision however the problem is I need the ...
0
votes
0answers
8 views

MelonJS - How can I change position of collided object (push or pull with player Entity)?

I'm getting started on game development with MelonJS and I don't get how can make a Pushable/Pullable Entity. I'm pretty sure that the approach I'm taking is not right since It cannot detect the ...
0
votes
2answers
54 views

How can I solve niche collision cases between circles and insides/outsides of AABBs or arcs?

I am trying to create a game with some interesting geometry. Literally all the geometry that is involved are the circles that move large distances per frame, and the edge of an iPhone X display, which ...
0
votes
0answers
33 views

Unity Mesh collider not working with capsule collider

I have in my Unity3d Project a capsule that represents a character and has a Rigidbody and capsule collider as components, and in my project I also have a mesh that is my terrain imported as fbx from ...
1
vote
2answers
67 views

Player gets stuck on edges between TilemapCollider2D tiles

I'm currently working on a simple 2D Physics-Based Platformer Project. However, I ran into the following issue: I'm using a Tilemap and a TilemapCollider2D to display the world. When I move the player ...
0
votes
0answers
23 views

Adding a collider to a wheel in a way that does not interfere with the suspension

I want to add a collider to a wheel so that it does not interfere with the suspension in any way but will allow the car to run into walls or other cars. The implementation of the wheel is as follows: ...
1
vote
1answer
76 views

Redundant checks from spatial partitioning

A simple 2D grid partition system for collision detection divides space into equal-sized tiles. Colliders then map themselves to tiles with their bounding box in O(1) time. Collision detection only ...
2
votes
1answer
69 views

How can one replicate the 'Quake Disruptor' of Wipeout XL/2097?

Following my previous question, I am wondering how one can achieve the same effect under Unity? The effect in action https://youtu.be/kzmmLeCwL0g?t=790 Description of the effect When you fire the ...
0
votes
1answer
62 views

2d Rectangle Collision Resolution: Find rollback point

I have a 2-part question: 1: I have 2 rectangles, A and B. B is a wall and A is moving. My simple logic here is every time A moves, it moves based on some (x,y) offset and then checks if it collided ...
1
vote
1answer
44 views

Sum of FoV enemies

so what I need is to calculate the sum of players' Field of view. Put simple, In a 2d space, I want to check how much they cover (in degrees). So here are a couple of use cases to explain by example: ...
0
votes
0answers
31 views

Collision detection not working on some parts of mesh

Racing game with a single mesh to act as a collider for all the track sides. Recently revised the mesh and now it is behaving strangely. The player correctly collides (bounces off) some parts, on ...
0
votes
0answers
8 views

Detecting when a single group of blocks is broken into multiple groups

Let's say you have an array of blocks (AABB), where each block is touching or intersecting any number of other blocks. Together they make up a larger object, and because they're all touching, you can ...
0
votes
1answer
37 views

How do i prevent my player from walking through mesh collider

I have a character being moved using rigidbody.moveposition and I have an floating lowpoly island with a mesh collider. When my player walks into a steep slope or a wall, it passes right through. I ...
1
vote
0answers
46 views

Getting the Closet Points between Polygons with the GJK Algorithm

I am trying to implement the GJK algorithm by following this lecture. For the most part, it is working, but sometimes 1 of the 2 closest points is incorrect. Here are two examples: EXAMPLE 1: The ...
0
votes
0answers
28 views

Detect how many blocks can be moved given a grid of blocks

Let G be a grid of booleans where true means a block is there and false means there isn't a block there. Let P be the player, ...
1
vote
1answer
36 views

Detecting a Collision Between Two Bodies Undergoing Multiple Transformations

I have been searching for an answer to this for a really long time and I have not found any definitive answers as of yet. What I am trying to do is determine if and when two bodies collided between ...
1
vote
2answers
47 views

Manual collision detection with a Box Collider 2D

My game is turn-based, so I only need collision to be detected after a specific game event has occurred, so for instance after every PlayerMoveComplete event. I could just define a MonoBehaviour ...
3
votes
1answer
77 views

Why does my collider rotate correctly on a slope only when a ray is cast directly from its center?

Edit: This answer might also be helpful to those who come across this question. I've been messing around with raycast collisions and slopes, but am having an issue when trying to get my collider to ...
0
votes
0answers
58 views

How to drag an object with mouse with collision?

I want to drag a GameObject with the mouse but I need collision. The basic mouse dragging code simply sets the position of the object to the hit.point with an ...
0
votes
0answers
26 views

How client movement prediction syncs with server position to avoid a clip around collision?

I have searched a lot on stackexchange and on google, yet I have not found a satisfactory answer to this seemingly simple question. I am making an online multiplayer game where the players navigate ...
2
votes
1answer
77 views

How to detect when the mouse is over a particular enemy collider, without falsely selecting bullet colliders?

I have an enemy shooting around. My game mechanic involves hovering over the enemy with the mouse to drain its health. While the enemy is moving, you need to follow it with your mouse. If you don't ...
0
votes
0answers
17 views

Inverse Kinematics with obstacle avoidance for the manipulator (arm)

I have a basic understanding of inverse kinematics, in that there's a workspace and a configuration space, and the point is to find a solution in configuration space that satisfies a workspace goal. ...
0
votes
0answers
32 views

Item collision detection doesn't work

My GameWorld constructor has the following code inside it. ...
0
votes
1answer
91 views

How can I make collisions in a game similar to Mario 64?

I'm currently trying to build a kind of Mario 64 -like game (very simplified). The environnement of the game will typically be a bunch of triangles issued from a .obj made on blender. Currently I ...
0
votes
0answers
29 views

Calculating Damage from from object collision

I need to calculate the damage resulting from a crash of two objects. I found the formula of the resulting kinetic energy: E = m * v² / 2 I guess I also have to ...
0
votes
1answer
30 views

Collisions in other sides on pong in python

Im trying to create pong in python, so far Ive set up correct collisions on the right paddle but upon just trying to reverse the code to work with the other side it refuses to work, simply glitching ...
1
vote
0answers
35 views

OBB vs Frustrum collision detection

Some definitions: An oriented bounding box (OBB) is a rectangular block which can be represented in many ways, as a collection of eight vertices, a collection of six planes or others, for this ...
0
votes
0answers
55 views

How can I handle two collisions in the same frame?

My problem is that I have a player with collisions, and enemy can collide with players collision and execute Hurt function in players script. But the problem is enemies can overlap and can hit the ...
0
votes
1answer
19 views

I can't find a way to make my projectile gameobject collide with my ofscreen collider

so my code on my collider is as followed public class Collide : MonoBehaviour { ...
0
votes
0answers
18 views

Drawing ortho outline of rotated elipsoid

I'm working on a collision system for a 2.5D game, and I'm stuck on the sphereoids. As long as scaling x=y=z, and it doesn't rotate, I can just use an r^2 check, but I'm trying to figure out a way to ...
0
votes
1answer
27 views

Detect collision with bullet physics, to make a character controller

I inherited from btCollisionWorld::ContactResultCallback but I really have no idea how to use this virtual function: ...
1
vote
1answer
64 views

Can't get AABB Collision to work properly

This is the code I'm using to resolve collisions on the players left side. It works when I'm on the ground, but if I'm falling, it does not work. ...
0
votes
1answer
91 views

SDL Sliding Collision

I'm working on a 2D SDL C++ project, and I'm having a bit of trouble with collision detection. Currently the player collides with the edges of the level and with the SDL_Rect objects in the level, ...
0
votes
0answers
38 views

Mirror effect on isometric map

I'm trying to make an isometric game with LibGDX and Box2D for collisions. The map and collisions lines are made in Tiled, but when transforming orthogonal coordinates to isometric with this code I ...
0
votes
0answers
71 views

How to get one KinematicBody2D to push another?

I am working in Godot 3, where my player is a KinematicBody2D. When I collide with a block which is also a KinematicBody2D I'd ...
1
vote
4answers
151 views

How can I convert Physics2D.Raycast to Physics2D.BoxCast to yield the same results?

This question has been updated to better reflect my current issue, and some of the progress made while solving it. I've been working on a 2D character controller that uses raycasting to detect ...
1
vote
0answers
37 views

Modding sprites in New Super Mario Bros. DS

I'm a New Super Mario Bros. DS modder. My goal is to create a custom sprite over an existing unused sprite. I checked in on fellow modders and they said theoretically, I could copy another sprite's ...
1
vote
1answer
45 views

How would I swap a character when a player touches a collider?

I wrote a simple script to attempt to do this and I created an empty game object and applied the script to it and dragged both of my sprites into my script and I receive no errors but nothing happens ...
0
votes
1answer
70 views

How is raycasting implemented

I know what it's used for, I know what it does. What I am essentially asking is what is the math/code behind how it works? I'm aware that any custom implementation would likely be slower than an ...
1
vote
1answer
89 views

2d side scroller slope physics and collisions

In old 2d games such as double dragon, streets of rage etc. where the player could move “up and down” on the y-axis to give an illusion of depth (as opposed to something like Mario) how were slopes ...
0
votes
2answers
133 views

How do I implement efficient collision avoidance in 100 enemies

I am developing a libgdx game. It is a top down shooter and I am trying to make a good AI. I have tried to implement A* from the AI library from libgdx and it works fine but when i have a lot of ...