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
0answers
30 views

How to avoid CollisionShape2D bouncing which prevents Area2D detection?

Consider the player with a rectangular CollisionShape2D: and a round enemy with a CollisionShape2D and a little bigger ...
0
votes
1answer
18 views

Function destroying wrong object

I am using the collision_line_list function to detect all objects of a type. In this case, the object is obj_CapMan. Code: ...
0
votes
1answer
17 views

Why Query Only fires OnComponentHit? It supposes to fires only Overlap events

I've just started to develop with Unreal Engine 4.26.2 and I've been for five days trying to understand how collision works. I'm developing a Pong game, and I'm trying to make that the Ball bounces ...
1
vote
1answer
20 views

How to transfrom CollisionPolygon2D according to the Vertex Shader applied to a Sprite?

Consider this: * KinematicBody2D - * Sprite - * CollisionPolygon2D And a vertex shader: ...
2
votes
1answer
38 views

Does collision between two Area2D work differently than collision with Rigidbody2D?

Consider a Main.tscn with: (1) a player: + Player extends Area2D |_ AnimatedSprite |_ CollisionShape2D The player has: ...
0
votes
0answers
10 views

Unity 2d overlapCircle melee combat issue

I have an issue with my overlapCircle melee combat in the game. I'm not good at such things, so I just copied that code from some YouTube tutorial. But the thing is ...
0
votes
0answers
13 views

Snake game collision with wall and reset

So I have a collision with itself and collision with the apple. I just cant figure out how to get it to collide with the wall. What my teacher helped me with was it made it teleport to the other side ...
0
votes
1answer
60 views

How do I detect if my object is grounded?

I am trying to detect when an object is grounded. My script right now is: ...
0
votes
0answers
27 views

Tell if two polygons are colliding

I want to make a function like areColliding which takes two polygons as args. I also want to cover cases like and the dreaded because I am trying to create a ...
0
votes
0answers
12 views

How to follow an object with the player without stepping out the waypoint line Unity3D?

How to follow an object with the player without stepping out the waypoint line? I added four waypoints with a debug.line and tried doing some simple waypoint mechanic. I wanted the object to move from ...
0
votes
2answers
40 views

Coins are solid objects and I can't collect them

I am just starting out with Unity following along with this video, and I am stuck at roughly 1 hour and 54 minutes in: https://www.youtube.com/watch?v=pwZpJzpE2lQ It is worth noting that the video ...
0
votes
1answer
16 views

How do I resolve a collision in SAT-3D when the projection axis is zero?

I am doing SAT in 3D, right now just between cuboids/3D rects (idk the terminology). I have intersection working fully, and static collision works as long as the projection axis is not zero. But if it ...
0
votes
0answers
18 views

Having Problems in PyGame with Mouse Cursor and Sprite Collision

I know something is not right but I'm just starting out and hit a wall. Basically, I just want to MouseClick on a Sprite and make something happen. The mouse clicking itself works, the sprite ...
0
votes
0answers
33 views

How to perform a sliding collision between a square and a circle?

Please point me to the duplicate if this has been asked before. I couldn't find it. Basically, I am creating a 2d top-down game where the player is represented by a circle, and the tiles are ...
0
votes
1answer
30 views

Help finding bug in seperating axis theroem code

My collision detection is inconsistent. I am testing between 2 rectangles. When they are un-rotated, it says they are intersecting way before they touch, but when I rotate one, it works properly. I do ...
0
votes
0answers
18 views

Melee Range trigger collider does not detect object with Player tag

In my 2D game, I have a Player which has: a BoxCollider2D with isTrigger=false a dynamic ...
1
vote
0answers
42 views

How can I fix glitchy Collision on my 2D game?

Update: I fixed the Negative axis glitch but the Invisible wall glitch still exists I have made a 2D game in Java and I rewrote collision as I added chunks. I have been having problems with the ...
1
vote
1answer
57 views

player teleporting into other levels

So I basically want to load another map once the player collides with a object, specifically a "Portal" in my game. Which is really making the player move onto other levels. I don't want to ...
0
votes
1answer
29 views

(Hitbox) OnTriggerEnter2D only work if enemy is moving

(UPTADE) I am developing a 2D Topdown Rpg Game. I have a problem with trigger colliders. I have button which make active an object and ı use it like Hitbox when i press button ı destroy enemy if it is ...
0
votes
1answer
30 views

Can you help me resolve a bug in mesh collision code?

I have entities which walk along a 3D mesh. I move the units along their x,z axis, and every frame I update their y-position according to the quad or triangle they are standing on, using Barycentric ...
0
votes
1answer
48 views

How to do topdown collisions properly?

I'm trying to achieve grid/tile based collisions like "a link to the past"; here is an article showing it off (sliding off the corners and such). I'm currently using this type of collision ...
0
votes
1answer
130 views

In collision detection/resolution, what is a “collide and slide” algorithm?

Can anyone help me to better understand the concepts behind this algorithm? I've seen this phrase come up several times during my research into creating a 3D character controller, but am having issues ...
0
votes
1answer
30 views

Sphere - AABOX Edge detection

I am trying to implement a particle-AABOX edge collision, the below images represent, two timesteps(dt) where the spherical particle is accelerated by gravity. I have the particle center C and its ...
0
votes
0answers
30 views

How can I make player object collide and keep moving until it is as close as possible to click location?

I am making a basic point and click adventure game. I can make the player object move towards the location of a mouse click and collide with walls, but movement stops the instant a collision occurs. I ...
1
vote
0answers
49 views

Fast self collision/intersection detection algorithm for tetrahedral meshes

I want to play with deformation of tetrahedral mesh (soft-body simulation) but I need help with self-collision detection stuff. I found SOFA collision detection but I'm not sure that it fits for self-...
0
votes
0answers
30 views

Unsticking game objects

I have used void OnCollisionEnter(Collision collision) { collision.gameObject.transform.parent = gameObject.transform; } To stick two players together when ...
0
votes
0answers
27 views

How to make googly eyes

I want to make googly eyes in Game Maker Studio 2 and I'm kind of close to what I want. I have a white circle object and a black circle object. When my black circle is colliding with the white circle ...
0
votes
0answers
28 views

Can not play a disabled audio source?

I have 5 cubes and all 5 cubes have an audiosource. When my player jumps into those cubes, the audiosource is playing just once. ...
0
votes
1answer
35 views

How to move through a game object - while getting the normal of the initial contact

In Unity, how can I detect a collision between two game objects, but have them pass through one another, i.e. not block each other? Specifically, I need the collision normal provided by the ...
0
votes
1answer
90 views

Character falls through the Platform Effector 2D in Unity. How can I fix it?

Character falls through the Platform Effector 2D in Unity. How can I fix it? Here is the demonstration: https://imgur.com/G5YkTxa. I tried changing the Edit - Project Settings... - Physics 2D - ...
1
vote
1answer
54 views

How can I jump down from a platform in Unity?

How can I jump down from a platform in Unity? I use two 2D colliders: one is my character, another one is platform. These colliders allow my character to stand on platform. Now whenever a characters ...
0
votes
0answers
13 views

Circle collider wheels push through polygon collider car chassis

I'm trying to create a simple vehicle and make it run on a terrain (from sprites + PolygonCollider2D). I imported a chassis sprite with ...
0
votes
1answer
63 views

OnTriggerEnter2D or OnCollisionEnter2D not getting called

I checked the other answers for this but mine didn't get fixed Here's the code ...
0
votes
0answers
15 views

How to see the surface arc in Unity?

How to see the surface arc in Unity? There is the tutorial and in this tutorial we can see the arc in editor: While I can not see it. I checked that all my gizmos are enabled. How can I enable the ...
0
votes
0answers
41 views

Penetration Depth into a Planar Polygon

I'm working on a self-made physics engine, and I'm wondering about the best way to calculate the penetration depth into a polygon that lies in a plane given that resolution must occur along the ...
0
votes
0answers
46 views

Godot raycast colliding too high

I am making an fps that uses a raycast for shooting. I used some suggestions taken from a few reddit pages, but it's mostly my own code. It was working properly, until I noticed that when you shot up ...
0
votes
0answers
43 views

Cannot decide between using a MessageBus and entities for events in my ECS game

For example, let's say that the player walks into an enemy and in response, a chain of events should occur (such as: his score goes up, the enemy dies, a cinematic starts, etc.) I see two "proper&...
0
votes
1answer
55 views

Swept AABB: finding collision normal in 3D?

I was following this tutorial which explains how to detect and resolve a 2d swept aabb collisions. I got the detection part working on 3d, but know I need a way to properly make a response, like ...
0
votes
1answer
55 views

How to detect if a 2D object overlaps any other 2D objects

I am programmatically placing 4 large dots on my 2D scene which already has some objects on it. If the new dot overlaps an existing object I want to destroy the existing object. All the objects have ...
0
votes
0answers
71 views

How to Implement One-Way Slopes?

I am working on a 2D platformer in Unity and am doing my own collision detection. I was previously using the method described in Sebastian Lague's popular YouTube tutorial, where you break your ...
0
votes
2answers
116 views

What's the maths behind checking line of sight

I understand in unity there is Phsyics.LineCast(Vector A, VectorB). What's the maths behind doing that, the only thing i can think of is going along the line at small intervals and seeing whether it ...
0
votes
0answers
23 views

Exact collision time of two axis-aligned bounding boxes

I am trying to calculate the exact collision time of two axis-aligned bounding boxes (aabb) as fast as possible (in the sense of CPU time). I have all the required information (aabb min, max, center, ...
0
votes
0answers
40 views

Ray vs AABB (2D) reporting hits

I've been working a 2D ray versus AABB implementation. I worked it out on paper, then read about a popular "branchless" algorithm. I decied to try the branchless one, but it gives me ...
0
votes
1answer
163 views

How can I destroy particles on collision with specific a GameObject?

I wrote a script to manage my Particle System emission. The starting lifespan is set to infinite so that the particle never dies until it reaches a specific collider. I didn't find any method to ...
0
votes
0answers
24 views

What does “ShapeRenderer.ShapeType.Filled”, “ShapeRenderer.ShapeType.Line” and “ShapeRenderer.ShapeType.Point” do in libGdx

I am creating a game and I wanted to include collision detection when I came across this: shapeRenderer.begin(ShapeRenderer.ShapeType.Filled); What is this and ...
1
vote
1answer
58 views

Determining first voxel ray intersects

I'm trying to implement the Fast Voxel Traversal Algorithm on a uniform grid of axis-aligned rectangles. Having read the paper, I understand how the traversing works, but not the initialization. I've ...
0
votes
1answer
43 views

What is the best way to check if a moving 2D object will collide with another immobile one before reaching its destination?

Provided that both objects have rectangular hitboxes, x and y positions and height/width, what is the best way to check if a moving 2D object will collide with another immobile one before reaching its ...
0
votes
1answer
54 views

How do I stop a moving object when colliding with a static wall or falling to a static ground

I'm writing my very first 2D game engine in C++ and SDL2. I wrote a very simplistic RigidBody class that computes the resultant force, applies forces and simulates ...
0
votes
1answer
74 views

How can I create a pressure pad in order to open a door?

I'm making a 2D platformer with Unity. I want to create a pressure pad in order to open a door and I want the door to open when the player is on the pressure pad and close in few seconds after the ...
0
votes
0answers
38 views

Issue with 2d Angular Car Collision Response

I am having trouble getting the angular collision response to work properly in my 2d car simulation. I have gotten the linear collision response to work between the vehicles, however, the angular ...

1
2 3 4 5
46