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
0
votes
0answers
11 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
24 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
26 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
18 views

Triangle vs Sphere collision detection

I am working on collision detection for my 3D game, and I don't really know how to approach this problem. I have an ellipsoid that i use for my player's collision shape. My idea is that I transform ...
0
votes
0answers
22 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
21 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
30 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
23 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
44 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
57 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
12 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
34 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
33 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
33 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
36 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
46 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
63 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
111 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
22 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
36 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
72 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
23 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
46 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
49 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
67 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
36 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 ...
0
votes
1answer
70 views

Swept 3d capsule intersection with AABB, what am I actually supposed to use to accomplish this?

I'm trying to figure out how to do continuous collision with a capsule (which would represent a collision volume for a player for example). Given how common the capsule is in many game engines, and ...
0
votes
0answers
29 views

How to implement layer based collision in C++?

I need layer based collision for my game, the problem is I don't really have an idea how to implement it. I'm using C++ and a graphics library called SFML. The only idea I got would be an array of ...
0
votes
1answer
34 views

How to prevent an object with high velocity from passing through a collider?

Consider a simple 2D platformer. I have a BoxCollider2D on the player object and a TilemapCollider on the ground below(grid). I ...
1
vote
0answers
28 views

Drag & Drop with a verifying system with BoxCollider2D

I'm really struggling to create a decent Drag & Drop system. The game idea is that the player would drag images (at the left side of the screen) to different slots (at the center) to create an ...
1
vote
1answer
39 views

All enemies destroyed when only one gets hit

I am trying to implement a new attack into my project. I can get the projectile to spawn and deal damage to an enemy, however, once it deals damage, every enemy gets destroyed instead of just the one ...
0
votes
0answers
12 views

How to display number of collisions on UI in Unreal Engine using nodes only?

I am using Unreal Engine and I want to show on UI the number of collisions using nodes only. How can I achieve that?
0
votes
0answers
33 views

How do I detect the side of collision?

I got a simple method of detecting collision between two objects. The next step is to figure out what side of the hitbox was hit so I know whether I need to push the other object back in X or Y axis. ...
0
votes
2answers
38 views

How to detect intersections with only colliders and not use the physics engine?

I do not want to use the physics engine, I only want the collider to detect when they have entered into another collider, then I want to handle what happens to the objects. Moving static colliders (...
0
votes
1answer
60 views

How can I detect a Gameobject touching another gameObject without using collider2D's?

I have fish gameObjects that have colliders2D so that I can click and move them. I added fish food with Collider2D's but it was hard for me to click on the fish. After I disabled the fish food ...
0
votes
1answer
85 views

Two Colliders on the same GameObject for different purposes

I'm somewhat new to Unity and am trying to build a battle system. Right now, I have an attack that checks collisions with enemy objects like this: ...
0
votes
2answers
50 views

Sliding movement on a grid

I'm trying to implement "sliding" movement on a simple grid, where the movement vector is continuous (floating point direction) but the grid is discrete (boolean blocked or open on integer ...
0
votes
1answer
52 views

Implementing Seperating Axis Theorem

I'm trying to implement the Seperating Axis Theorem by following this article I found on MDN. Unfortunately, I'm not too geometry savvy and I wasn't able to find any good, simple implementation ...
0
votes
0answers
35 views

“Blind” PathFinding for fleeing agent

I know there are plenty of algorithms for finding a path from A to B. There's also a good few articles on how to avoid an enemy in a 2D space. I can't find anything on escaping from an enemy in a ...
0
votes
1answer
34 views

OBB vs rectangle/quad/plane with bounds collision detection/response

I am able to resolve collision between an OBB and a plane but can't get it to work when I introduce some bounds on the plane size. I want to have the plane of width ...
3
votes
1answer
174 views

Intersection of thick line with a grid

There is a popular paper, and numerous examples, on how to efficiently perform collision detection for a line with a grid. However, I'm drawing up blanks on how to do the same thing but with a line ...
0
votes
0answers
103 views

How do you use custom collision on a skeletal mesh in UE4?

I have a vehicle rig that is a skeletal mesh that imports fine in to unreal but I was wondering how to use a mesh for collision on it. Normally you can just name the collision mesh with UCX_ in front ...
0
votes
0answers
12 views

Unity: Tag collision doesen't respond [duplicate]

I'm starting developing in Unity. I am trying to make a script that checks a collision of the gameObject assigned to the script, with another object with a tag ...
0
votes
1answer
289 views

Checking if player is grounded using tilemap collision detection

beginner here just trying to learn the basics. I was following this tutorial but I ran into some trouble. Heres a screenshot of unity So the tutorial calls for tagging the terrain with "Grounded&...
0
votes
2answers
68 views

Is collision detection with static environment necessary for npcs

I can't find any information on this topic. I'm wondering about the differences between the collision detection approach for player as opposed to npcs. Basically NPCs will move strictly along the ...
1
vote
2answers
172 views

Optimizing a quadtree for circles and circular queries

I'm developing a 2D ant simulation in JavaScript. I'd like to implement a quadtree to store the positions of ants and other markers. I approximate all of these entities as circles, and I'm only ...
0
votes
0answers
54 views

Why my capsule collider sometimes stucks in other colliders?

I'm creating a third person game, and sometimes I face a strange bug that I cannot figure out. Indeed the player may remain stuck in static scene objects, and cannot escape until an angle large enough ...
1
vote
0answers
42 views

Proper sphere collision resolution?

I am implementing a sphere to sphere collision resolution and I am a little confused on where to start. First question, is there a standard way that games/engines do sphere to sphere collision ...

1
2 3 4 5
46