Questions tagged [collision-detection]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
54 views

2D Collision detection: rewinding to moment of first intersection

I am working on a collision system in a Platformer tile-based game. All tiles are AABB. I am trying to implement "Rewind to Moment of First Intersection" mentioned in this post's second point. The ...
0
votes
0answers
30 views

Adding Score to score canvas after collision [duplicate]

Simply a player has to move through pipes falling down, once the player moves through the gap it should add a score and increase the scoring after each pipe the player goes through, pretty basic. I ...
0
votes
1answer
71 views

How can I keep track of which “rooms” characters and NPCs are in?

I have a Unity 2D project which has a player character and numerous NPCs all potentially moving (top-down) at the same time during play. The number of NPCs is not to exceed 100 (and will be, probably, ...
1
vote
0answers
33 views

What would be the best way to let Box2D handle collision on different (simulated) heights?

I'm working on a 2D top-down game but we are also using a Z coordinate. This is to simulate the effect of 3D/height. Now the player can walk under a bridge and also over a bridge. The next thing I did ...
2
votes
1answer
270 views

Tilemap collision in Pure ECS?

I'm currently making a 2D topdown dungeon crawler using pure ECS and Data Oriented Design. So I only use structs of arrays for all my components. I have now added tilemap generation, but was wondering ...
0
votes
0answers
67 views

How can I implement ground clamping across slopes in my 2D collision controller?

I'm working on improving my 2D collision controller, but am having trouble with "ground clamping" when my object moves past certain slopes on which it should be descending. The controller takes the ...
0
votes
2answers
35 views

Unity3D playing sound when Player collides with an object with a specific tag

I using Unity 2019.2.14f1 to create a simple 3D game. In that game, I want to play a sound anytime my Player collides with a gameObject with a specific tag. The MainCamera has an Audio Listener and ...
0
votes
0answers
102 views

Elastic Collisions in Unity 2D

I am trying to create elastic collisions in 2d game in unity. I have a ball surrounded with a polygon collider and im calculating the reflected vector using the ball velocity and the normal at the ...
0
votes
2answers
83 views

Player disappears when it collides with a tagged object

I am working on a simple game where the goal is to help a Player catch specific objects with a tag "Present". After taking care of the models, animations I am now working on the collisions and ...
0
votes
0answers
19 views

Preserving original direction when collision changes direction

I have sliding for player characters and it's working, but running into a small issue. The original direction gets lost, and I'm unable to resume the original direction. My characters have a ...
0
votes
0answers
38 views

Catch blocks while dodging other elements game

I'm working on this game where the user gets points for catching the right falling colour block. If the user catches the wrong colour block they will loose the game. For ex: I assign the user to ...
0
votes
0answers
31 views

Obb vs triangle test is incorrect

I have programmed Obb vs Triangle test from https://www.geometrictools.com/Documentation/DynamicCollisionDetection.pdf. However, when I run the test, I got incorrect results. I have this test case: <...
41
votes
1answer
4k views

How to differentiate landing on top of an object from falling down the side?

I am looking for a conceptual solution to my problem. It's a simple platformer-alike game where player can move horizontally during free-fall. Consider those two cases: In the first case, from game ...
1
vote
1answer
467 views

Don't block Camera with Blocking Volume in Unreal Engine

I use Blocking Volumes to prevent players from falling off platforms in a third-person perspective game in UE4. These Blocking Volumes however block the camera, as if they were a physical wall. How ...
0
votes
0answers
21 views

How to detect collision while the animation is running to move an object to the next coordinate?

I implemented SAT collision detection in Python with the GUI library pygame. It is working well, except when the objects are going too fast. I have velocity and acceleration variables. For each loop ...
1
vote
1answer
59 views

body_entered signal won't emit when rigidbody collided to rigidbody

I have multiple rigidbody object floating away in the space. When they hit each other, they push away each. I want to destroy object if they hit something, but connect body_entered signal won't ...
0
votes
1answer
86 views

Pybox2d Collision detection explanation

Hi I am working on a PyBox2D game and it became quite complex and I need to learn about collisions, so I made this very simple script in order to learn collision setting more effectively, however I am ...
0
votes
0answers
45 views

RigidBody Collision Handling with Verlet Integration

Hi I'm reading the Jakobsen Paper "Advanced Character Physics" which explains how the verlet integration along with a tetrahedron (4 particles) can form a structure usable for rigidbody (with 6 length ...
1
vote
1answer
50 views

How to detect a collision and collision impact?

I would like to calculate "impact" of collision if its the right word for it. My scenario is: I have player, who is driving his vehicle. He then hits the wall while still in vehicle. I want to know if ...
0
votes
1answer
63 views

Unity get reference of GameObject under another GameObject

I am trying to get reference of the object underneath my Player. I don't know if I am aproaching this correctly. Right now, I have a player simply put in the scene, like this: Then I am trying to ...
1
vote
2answers
74 views

Resolving collisions after initial collision

Given a sweep test for a ray, how do we check collisions after the 1st collision has been detected, and the ray has been deflected. Physics system steps are: Update velocities (gravity, etc) Resolve ...
0
votes
1answer
1k views

Unity 3D move kinematic rigidbody

I'm trying to move a kinematic rigidbody (a spaceship) with this code: ...
2
votes
1answer
337 views

3D line segment AABB collision, with hit normal?

I'm embarrassed I can't find this, but I'm wanting to detect intersection with a 3D line segment (not an infinite ray) with a 3D AABB, the AABB being defined as two Vec3f's which represent the Min and ...
0
votes
1answer
49 views

Detect collision on explosion

I am creating spells for my game. The collision with a normal fireball works just fine, what I am trying to achieve is to have the player_2 getting hit when the ...
0
votes
0answers
26 views

Numerical errors in Player collision offset causing player to fall through the ground the next frame, how to avoid?

I'm trying to implement player physics with arbitrary objects, in this case, a bunch of cubes. I wanted to add a "floor" so in my cube collision function, I added the following following lines: <...
0
votes
2answers
217 views

How do I detect collisions between a point and a sloped line?

The character in my game constantly falls due to gravity, so i have to detect the collision between the bottom point of the character and the tile slope line on the same x coordinate. The character ...
-1
votes
1answer
75 views

How to make wheelcollider not stutter when moving on high speed?

I have a wheelcollider attached on a rigidbody and i move the object using : "transform.position += transform.forward * speed * input.getkey(keycode.uparrow)" And when the speed increasing the ...
0
votes
3answers
110 views

Both Trigger and Collision BoxCollider2D

My Player sprite needs to collide with some objects and be unable to pass through them and in other cases detect when it passes through some object (e.g. some non-...
0
votes
2answers
98 views

Get Closest point between a Box 3D and a Point

I have a point A (x, y, z), and a Box: Center (x, y, z), Size (Width, Height) How to get the closest point in the box from the point A ? In Unity I can create a bound, and I can find the non-rotated ...
0
votes
1answer
41 views

Space game scene boundaries

I've been trying to add boundaries to my space game. I've been following this tutorial with a sphere instead of a cube, but every time I start the game and move or rotate my ship it appears outside ...
3
votes
1answer
368 views

Quadtree for AABB collision boxes

I have a whole bunch of entities constantly being processed and testing for collisions. I've tried to optimize this by stopping certain entity types from checking each other, dead entities not being ...
0
votes
1answer
59 views

3D Collisions - Walking below a slope pushes me through the floor

Here's a really short video (less than 30s) of this issue : https://www.youtube.com/watch?v=JrKbpTY8cMU When I move the player towards a slope (the player is below it), it pushes the player inside ...
0
votes
1answer
70 views

Box2D Weird collision behavior

I'll let the gif speak first. As you can see, the small cube just kinda floats there like it has a forcefield. This weird glitch only happens with small cubes, smaller than 60 pixels for some reason. ...
0
votes
2answers
136 views

How to handle objects at the edges of spatial partition cells?

A lot of games store object positions as floats and have a closed ball for the game area (eg. a rectangle and objects are allowed to have position coordinates on all 4 edges). However, this becomes ...
0
votes
1answer
46 views

why child class can access object while parent can't

I have Block class which is the parent and StandardBlock the child , the prefab block have StandardBlock script attached to it, and according to my small knowledge in inheriting I though this would ...
1
vote
2answers
114 views

How To Resolve Collision Before it Occurs

I have 2 objects, A and B, in a 2 dimensional space. If I know A is trying to move by vector M (that is to add vector M to the positional vector of A), and that A will collide with B after A moves, ...
1
vote
1answer
76 views

Using logic gates for Sprite Collision Detection - humor an old fart please

Im an old coder who came back so to speak, learning Java I know what I want but I cannot find anyone asking it anywhere so here goes... Im writing a basic tank game to code for practice but as is ...
1
vote
1answer
27 views

The collision log is displayed only for the original obstacle and not for the duplicates

This is my first game attempt and I'm trying to create a game where my player (a box) stops whenever it collides with an obstacle. However, the log for the collision is only displayed when the player ...
1
vote
1answer
70 views

Collision Detection For A Maze/Cave

I have a simple code written in Processing 3.x that I am using to test out the collision detection for a cave/maze. The code is here: https://github.com/NoahJon3s/New-Journey-The-Game/blob/master/...
0
votes
0answers
102 views

Moving point (as line)-Polygon collision detection

i've reached a good point with my engine, with static/instant collision detection and callbacks in case of collision. By instant collision detection i mean: Object A moves from x1y1 to x2y2 Check if ...
0
votes
0answers
82 views

brick breaker game - object collision problem - ball get's stuck in corners

I'm working on a game of brick breaker and I've encountered a problem that I can't figure out. whenever the ball collides with the corners of the peddle it starts vibrating (it's Yspeed vector changes ...
0
votes
0answers
22 views

Stop the player to prevent it from being thrown away after collision

I'm trying to write a script where when the player (kinematic) comes up against an enemy he stops, jumps and gets dynamic again. The problem is that when it returns dynamic it is thrown away and does ...
0
votes
0answers
83 views

What is wrong with my collision detection?

I am trying to create a collision detection system between block using this code: ...
0
votes
1answer
140 views

What to do with collision detection?

I am able to get collision detection (CD) into my game but... what do I do with it? Do I push the player back to the last location? Something else? I am programming the game in C++ using the Irrlicht ...
0
votes
2answers
596 views

Dragging a Rigidbody2D without passing through obstacles

I have this body of code written for an object that needs to be an obstacle and another object that is draggable. I have colliders on both and a kinematic rigidbody on the draggable object, but the ...
0
votes
0answers
20 views

Keep my 3d player from jumping if he's not on the Ground [duplicate]

I'm making a 3d game, and I have only made games in 2D before, but i have used blender before too. My player can now walk and jump, but he is not limited to only jumping of the ground. In 2D, you ...
0
votes
1answer
50 views

How to construct this collision vector?

I have a 3d game, but for movement I use only two axes (X and Z) - X is vertical, Z is horizontal Here's what I'm trying to achieve: Player is the circle, InputDirection is Blue, NewInputDirection ...
0
votes
1answer
32 views

Character blocking when walking on cube edges

I have my character walking on a ground made of cube. (scale 1,1,1). There is no space between them. Also, I have a RigidBody with 15 drag and I'm moving with <...
0
votes
1answer
82 views

Collision detection and solution causes teleportation on corners

I am making my own game engine on Python and I got stuck with collision between objects. ...
1
vote
1answer
321 views

OverlapBox() dimensions are huge but are fine when tested in isolation

To be completely transparent, I more-or-less copied this question from the Unity forums since I did not get a reply. I'm creating this system where I'm placing level chunks together and I need to ...

1 2
3
4 5
45