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
13 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
64 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
55 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
89 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
37 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
37 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 ...
0
votes
1answer
17 views

Collision with supposedly aligned box-colliders

I am quite new to game development, and I am trying to create a top-down game with 2D sprites, but with a 3D feel to it. I managed to do so with the 2D engine by setting ...
1
vote
0answers
12 views

Acceleration structure for AABBs with many overlaps

I have large number of AABB in 2D. They are created around complex polygons and I use them as pre-test before real point in polygon test (which is expensive). I was thinking of creating acceleration ...
0
votes
0answers
38 views

C++ Help with Separating Axis Theorem

I am trying to detect collision between two triangles using Separating Axis Theorem however I am unaware what is wrong with my code. The CollisionHelper::isTriangleIntersectingTriangle is called every ...
0
votes
0answers
17 views

Pile of objects & collisions

I’m designing something which has a rather large number of 3d roundish objects and needs collision detection, in the best way I can muster. The user can move her fingers through the pile of objects ...
0
votes
1answer
52 views

How to detect which car T-boned the other in a collision?

Setup The game has cars and collisions, and I'm trying to create the following system: When a car T-bones another, the one getting T-boned is destroyed; When the cars collide laterally (usually just ...
3
votes
1answer
48 views

How can I detect enclosed areas in an arbitrary set of overlapping lines

I have game where there can be arbitrary lines, these lines can overlap. I want to find out first if there are any enclosed shapes created by overlapping lines, and then I want to fill the enclosed ...
0
votes
0answers
29 views

What would be the best way to find a Game Object that is closest to another Game Object in unity?

I made a 2d space shooter game awhile ago and I want to go back into it and overhaul some things. I'll provide a link to the game so anyone can play and get a better understanding of what I'm trying ...
0
votes
0answers
22 views

How to implement joints in and impulse based engine

I have been writing a 2D physics engine (for fun and learning) for a while now. I have managed to implement collision detection along with collisions responses with angular impulse and frictional ...
3
votes
2answers
160 views

Swept AABB Collision Detection Conflict with Tile-sized Gaps

Background The sweeping method for detecting and resolving collision has proven to be very versatile to implement collision for our game, and I have this GameDev.net article to thank for that: https://...
0
votes
0answers
9 views

Check if triangle collides with any object in certain LayerMask

I am creating a custom navigation mesh and in order to see which triangles in my mesh are traversable I need a way to check if anything on a certain LayerMask in my ...
0
votes
0answers
16 views

Unity 2D collisions imprecise

I am trying to make a platformer. For the player character I am using a kinematic rigidbody because I want to calculate the jump curve myself (including physics & gravity). The platforms are also ...
0
votes
0answers
25 views

Calculating radius during collision

This picture is from one of Dirk Gregorius' presentations: The original diagram has only one contact point (the red one). The r_1 and r_2 vectors are required to produce rotation while solving the ...
0
votes
2answers
61 views

Jittery collisions in Unity 2D

I tried to implement a simple movement to my object. My object moves perfectly fine but I'm having issues with its collision. When I keep on moving object towards the obstacle/ground, collision are ...
0
votes
0answers
15 views

Contact points in collision

I am making a GJK-EPA based collision detection routine. In this picture, the algorithm picks up on two contact points (the endpoints of the green penetration vector). I'm certain that the penetration ...
0
votes
0answers
17 views

Collisions with complex assets from Blender in SceneKit

I have a very basic workflow question: I'm prototyping a game with Apple's SceneKit framework. It can automatically create a mesh for collision detection, but it will always be a convex hull. This ...
0
votes
0answers
18 views

What is the correct formula for penalty forces?

I am trying to add penalty forces between two hard body objects, so when they collide they move in a realistic way. What I have so far is this: ...
0
votes
0answers
33 views

How does skin width work in Unity's CharacterController?

I'm trying to write my own character controller and I want to understand how Unity's works. I think what it does is this: at each fixed update it takes the smaller collider reduced by the skin width, ...
-1
votes
1answer
25 views

How would I detect a collision between a rigidbody and a static

I have an object with a rigid body. How would I go around detecting collisions between this object and any other object with a collider on it? I know you can enable/disable collision detection (https:/...
1
vote
1answer
21 views

How to make collisionshape2D work from other scene in Godot?

I have created a scene which contains Area2D, CollisionShape2D & AnimatedSprite. Then I ...
0
votes
0answers
17 views

Efficient acceleration structure for moving 3D objects in scene

I am implementing a 3D FPS game in C++. The game has large outdoors areas with both static and dynamic objects in the scene, with the following implicit assumptions: Static objects: Do not move ...
1
vote
3answers
74 views

2D Finding an algorithm to check pizza toppings positions

Using unity 3D I am creating a 2D pizza game and I am stuck at finding an algorithm to solve this problem which is Detecting if the pizza is half and half taking into consideration that the user can ...
0
votes
0answers
32 views

Per pixel collision depth

I need to modify the code below to get the penetration depth from the per pixel collision and return it as a Vector2 to later apply it to the character position. ...
1
vote
0answers
15 views

Getting “continuous collision detection”-like behaviour out of triggers

I have a particular scenario where I want to use a trigger to adjust the course of a fast-moving projectile, but am running into issues because Unity does not support continuous collision detection ...
0
votes
0answers
17 views

What is the most efficient way to find hit point of BOX and internal Ray?

most efficient AABB vs Ray collision algorithms I found this topic on AABB ray test. Some of them could find hit point of external Ray and BOX. I did my version for both external and internal ray, but ...
0
votes
1answer
24 views

Collisions and Colliders

Does anyone know how to prevent a gameobject from colliding with another gameobject but can still register collisions? Like a ball that can bounce off of the wall or ground and can pass through the ...
0
votes
1answer
78 views

In a top down game, once I have detected collision, how do I prevent it?

I'm making a top-down game in Java. I watched some videos, and this is the code I currently use when the player is colliding with an object: x += -velX y += -velY ...
1
vote
0answers
24 views

How to build bullet (hit) damage detection in Augmented Reality to a real life person acting as an opponent?

I am building an Android AR game using ARcore 1.18 in Unity 2019.4.5f1 (LTS). Now I want to create something like bullet damage detection just like it is built in a normal Unity 3D game. Of course, ...
0
votes
1answer
35 views

Player hitting bottom of tile when beside it?

So my player checks if it is colliding with tiles, and it works pretty good. However, when the player is against a wall, moving upwards and sideways, it detects it as hitting the bottom of the wall ...
0
votes
1answer
45 views

OnCollisionEnter2D not working

I am fairly new to Unity2D and am making a 2D platformer to get used to the engine. I am trying to create a platform that moves when the player jumps on it, however, on the script for the platform the ...
2
votes
1answer
46 views

Non-rectangular collision detection in Python and Pygame

I am programming a ray tracer in python, and I have gotten as far as making a character that can move across a 2d plane and change direction of movement when needed. The problem is this: I want to be ...
0
votes
1answer
118 views

Godot: How do I create a temporary invincible state or invincibility frames?

My issue I have been racking my head around how to achieve invincibility frames. Working in the Godot Engine I have considered a few methods for this: Setting a Timer Node when damaged to trigger the ...
0
votes
2answers
66 views

if touching line renderer (do something)

I have this laser script for a ship and I am trying to make it kill an enemy when it is hit with the line rendered laser. How can I achieve this. All things I found online I just could not get to work....
1
vote
1answer
100 views

OnTriggerEnter not working when placed inside Update()

I'm making a scanner that scans the "world" (like a 10 x 10 space), and I'm trying to sense a GameObject called pointer. They both have colliders, they ...
1
vote
1answer
75 views

Implementing melee combat in pygame?

I've gone about 2 ways for implementing melee attacks however, bboth have major flaws, hoping someone has a simpler answer. Method 1: Creating a "projectile" that's using an image, then ...
1
vote
0answers
64 views

How to use continious collision detection in a dynamic AABB tree

I am currently writing a game in c++ using openGL, and I am currently using a kinetic sweep and prune algorithm for the broad phase and then using GJK Raycast + GJK & EPA for the narrow phase. ...
1
vote
1answer
100 views

Godot 3.2 Bomb explosion doesn't affect player or npc

I finished the Godot 2D game tutorial Dodge the Creeps, and i'm adding a few additional features to reinforce the things learned and make more interesting the base game. Basically i added a Scene ...
0
votes
0answers
16 views
0
votes
1answer
364 views

How to do collision detection in Unity between Character Controller, Rigidbody Collider and a NavmeshAgent?

I would like to know more about how collision detection works in Unity especially when character controllers and NavmeshAgents get involved. For example, how can I detect collision between ...
2
votes
1answer
52 views

How can I position a large amount of boxes to prevent overlap efficiently

I've been working on an asset to position labels like they do in Diablo or Path of Exile, but I'm having trouble finding an algorithm to position the labels efficiently. Currently I just boxcast in ...
0
votes
1answer
38 views

collision detection and normals from rigidbody

Until now I've been developing my player character using a Character Controller, but have since decided to switch to rigidbody due to the controller's limitations. In order for my movement code to run ...
0
votes
0answers
27 views

Pygame Collision | Why do I slide up walls in my tile based game?

My player if in contact with a wall either left/right/top(head) they will be able to just continue in the Y direction if you press jump as if you were flying. This is for all walls and invisible walls ...
0
votes
0answers
50 views

Creating runtime mesh colliders for roads in Unreal Engine 4

I want to create several mesh colliders in game at runtime. By mesh colliders I mean "complex collision". The meshes are for curved roads. The roads will be rendered using hierarchichal instanced ...
0
votes
0answers
24 views

Pygame Tiled Map Object layer collision

I'm using pygame to make a top down shooter I've placed my tiles and object layers using Tiled Map Editor. My player and mobs collide with their spawn locations (object layer) is anyone able to help? ...

1
2 3 4 5
45