Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

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

How to implement a directional attacking/blocking system?

I'm working on implementing a directional attacking / blocking system in Unity à la Elder Scrolls: Arena or more recently, Mount & Blade - where moving the mouse in a certain direction signals a ...
user avatar
0 votes
1 answer
21 views

How to properly set up a lives system for a side-scroller in pygame

I have a game where the player has to dodge asteroids coming towards it, and I would like to incorporate a life system. Unfortunately, when I tried this, it still killed my player immediately. I ...
user avatar
0 votes
0 answers
16 views

Collision not being detected on CharacterController in Unity

Help! For whatever reason, I was following a tutorial on Unity movement, and when I was going to test out collision for certain objectives in my game, for whatever reason collision is not being ...
user avatar
0 votes
1 answer
19 views

2D circle and rotated square collision detection and response

I'm creating a 2D multiplayer game in javascript, but I'm actually struggling with a problem (not really a problem, but I don't know how to do). My player have a circle hitbox, so 2 circle collision, ...
user avatar
0 votes
0 answers
18 views

Virtual Camera with Collision

I am using a VirtualCamera2 Actor for recording sequences using iOS devices + Xbox Controller as input devices. Everything works well except for collision. I tried to add it in many ways but it doesn'...
user avatar
0 votes
0 answers
17 views

line renderer collision detection in 3D

I've been using the code down below to simulate a rope physics (based on this: Create Rope Bridge, String in Unity - Verlet Integration Part 2). Currently, it uses edge collider 2d to detect collision....
user avatar
0 votes
0 answers
32 views

How do I make two circles overlap in pygame?

I am a beginner in pygame and I have little knowledge on collisions. ...
user avatar
  • 1
2 votes
1 answer
53 views

Godot: is_on_floor always false

This is an extremely simple game (following tutorial). My code and configuration allows the actor object to fall on a platform made of tilemaps and not fall through, but the function is_on_floor() ...
user avatar
1 vote
0 answers
32 views

Wall sliding collision resolution with multiple objects

TLDR My collision resolution algorithm with wall sliding works perfect for multiple walls but it fails when the angle of the corner of two walls is less than 90 degrees. (acute angles) and the player ...
user avatar
  • 115
0 votes
1 answer
49 views

Detect if actors are inside another actor with custom shape

I have few actors with custom, non convex geometry (mesh) created using PxRigidActorExt::createExclusiveShape and a lot of actors with ...
user avatar
  • 111
3 votes
1 answer
96 views

Unity CharacterController steps on colliders with 0 Step Offset

I'm moving my CharacterController with the Move() method and for some reason it still steps on colliders even though its Step ...
user avatar
  • 626
0 votes
2 answers
72 views

How to reconcile collision detection with delta time?

In my simulation, if an object is inside another object, it imparts a force proportional to the distance inside the object (basically a separation force). I am having an issue though where the ...
user avatar
0 votes
0 answers
41 views

What is the most efficient way to detect collisions of a large number of similarly sized objects?

Also, the maps are around 4000x4000 (pixels) So, all the objects in my game are 2D circles, and they all have a radius of between 5 and 10 pixels. My current solution is to use a spatial hash where ...
user avatar
0 votes
2 answers
82 views

How to efficiently do one-to-many collision checks?

Scenario: 4 players, each can have from 1 to 100 pawns. I want to be able to efficiently check if Player 1's pawns collides with Player 2, 3, and 4. Currently I have an AABB check, done first on ...
user avatar
  • 15
1 vote
0 answers
55 views

2D tilebased collision system

Hi i want to implement a collision system (something comparable to super mario) I would like it to have objects which can have any size (the hitbox of it) And it should be reasonably efficient (so ...
user avatar
  • 11
2 votes
1 answer
41 views

Problem with bullet colliding with multiple enemies instead of one

I have a bullet script that trigger on collision with an enemy, problem is when two enemies colliders overlaps and trigger with bullet both disapear instead of one only. Is there any way to only ...
user avatar
0 votes
1 answer
67 views

Godot KinematicBody2D Invisible After If Statement

The reason I address this question is because of the limited documentation and support for starting devs on Godot. I do not know what is wrong with this one if statement, but after I added it, my ...
user avatar
0 votes
1 answer
37 views

How to make a capsule Rigidbody player "kick" a Rigidbody sphere (ball) in Unity?

I am just learning the basics of physics simulation with rigidbodies. I am trying to simulate some basic real world functions like kicking a ball. Let's say I have a simple capsule mesh/collider as my ...
user avatar
  • 197
2 votes
2 answers
112 views

How to differentiate between enemy and something else in Godot?

So, I have a simple 3D game with a player, an enemy, and walls. I've figured out how to detect collisions between my player (RigidBody) and an enemy or wall (Static Body). I want to know how can I ...
user avatar
1 vote
1 answer
60 views

DooM P_BulletSlope function , how does it works

I'm trying to understand how DOOM source code works, the problem is I don't understand a few things, why is it 16 * 64 * FRACUNIT ? , i don't get it. ...
user avatar
  • 111
0 votes
1 answer
51 views

In a portal-based engine where Items are owned by a room, how to do inter-room collision detection?

My engine consists of Rooms. Rooms are connected via Portals. Items have a roomNumber field to indicate which room they belong to. And rooms have a linked list of ...
user avatar
  • 641
1 vote
1 answer
82 views

How can I tell if my raycast hit a tree?

I have a TerrainGridSystem grid on a forested terrain. The grid system draws a grid onto the terrain to set up a game board. I want to find all the trees and mark ...
user avatar
0 votes
0 answers
12 views

Unity3D object falling from high are passing through ground [duplicate]

First, you can see the bug in action here: https://www.youtube.com/watch?v=vqbo3rweEmA When rigidbody objects are falling from high position (300 in my test), the ground collision doesn't works, the ...
user avatar
  • 101
5 votes
2 answers
1k views

RPG - How to deal with the collision of a sprite with a side-view thinner than its front-view?

I am currently working on a role-playing video game featuring sprites that take the form of antropomorphic objects. These sprites can move around in the four cardinal directions, and turn to face the ...
user avatar
  • 53
1 vote
0 answers
103 views

No Collision while rotating. Object rotating with Rigidbody.Rotate passes through other collider

I'm working on a 3D game, and having issues with the colliders. My Cube Controller has movement input by keyboard, with collider and rigidbody components. Cylinder objects have basic colliders and ...
user avatar
  • 11
0 votes
0 answers
16 views

Is there a lighter way to implement "object stops when hit wall" without relying on Dynamic gameobjects in Unity3D (2D)?

I am currently using a Dynamic GameObject for my entities, but I feel as if that will risk slowing down the game on weaker hardware (especially when there are hundreds of entities). Not only that, but ...
user avatar
  • 1
0 votes
0 answers
81 views

How to display ray collision object with Ray Perception Sensor 3D Unity ML-Agents

I try to detect collisions with the Ray Perception Sensor 3D from Unity ML-Agents. I read that collisions with colliders through the rays will be automatically added to observations. How can I display ...
user avatar
0 votes
1 answer
55 views

How can I make a hitbox around my image?

I'm really new to PyGame and trying to program a game, and I can't figure out how to make a hitbox that when this image hits the edge, the game stops it from going past the edges ...
user avatar
1 vote
1 answer
121 views

How do I get OnTriggerStay2D to consistently work in Unity?

(2D Project) I have a very basic set-up in which I have a Hallway with a door and a bunch of other objects. I have a player that starts on the left side of the hallway and only moves on the x-axis. ...
user avatar
1 vote
1 answer
47 views

UE4: How to make UProceduralMeshComponent a solid body, not just a surface around volume?

I generated the UProceduralMeshComponent and set collision enabled to ECollisionEnabled::QueryOnly. But I get ActorEndOverlapEvent if I stop touching the mesh border even if I still inside of mesh ...
user avatar
  • 231
0 votes
1 answer
44 views

My character runs around on their own after picking up an object

I have a weird bug on my hands. I am trying to create an event whereby the character walks into an object and automatically picks it up once the collision occurs. The character can pick up the object (...
user avatar
  • 1
0 votes
1 answer
39 views

how to detect a 2d box collission with 3d box colliders

I have a bunch of TextMeshPro labels in a scene at various x,y,z positions and I would like to detect when labels overlap from the camera's perspective so I can keep the labels from stacking. The ...
user avatar
  • 191
0 votes
1 answer
50 views

Sliding character inside the circle

When it comes to rect against rect smooth sliding movement, that is easy. Something like this will work ...
user avatar
0 votes
0 answers
21 views

Get all the objects which are involved in a collision (exactly) in Unity with C#

How can I get exactly all objects which are involved in a collision? The objects which collide in my case containing of several childobjects from which I need to know which of the childobjects is ...
user avatar
1 vote
0 answers
131 views

Smooth collisions with a triangle mesh

I've got a ground mesh which is comprised of a collection of triangles. When the box moves along the surface it sometimes collides with the internal edge. The way I'm handling collisions for each ...
user avatar
0 votes
0 answers
22 views

Javascript Game Collision Shaking

I have a problem with collision shaking. The problem doesn't come from the collision, but from client side (sometime the it's smooth and sometimes not). Here is a video to show it : https://www....
user avatar
2 votes
1 answer
52 views

How can I keep a node in-place while I re-parent it?

I have an object that needs to follow various Path2D paths in my scene. To do this, when it needs to follow a path, I re-parent it to a ...
user avatar
  • 1,115
0 votes
0 answers
35 views

Sphere collision resolution when colliding with multiple meshes

I'm writing my own player collision physics and I'm stuck at collision resolution part. I have sphere as a player and scene made of static meshes. Collision resolution works fine when player is ...
user avatar
0 votes
3 answers
116 views

Why am I getting Null Reference Exception inspite of checking if the Object is not null to execute something

Hi I am just trying to convert a simple flappy bird game into multiplayer game. So In the multiplayer game using Photon , I want the bird to collide with the ground or pipe but not with the enemy bird ...
user avatar
1 vote
3 answers
466 views

Unity2D Grid-based Sprite Movement and Tilemap Collision

I have just started working with Unity2D to simply learn how it works. I've been trying to get grid-based movement and collision with a tilemap working, and it's mostly there, but there's one bit that'...
user avatar
1 vote
1 answer
278 views

Why is Area2D not detecting collisions?

I am making a sidescrolling shooter and I am working on the shooting mechanism. I have two scenes, one contains a KinematicBody2D with a Sprite, position2D and a collisionshape2D and a second ...
user avatar
  • 45
0 votes
0 answers
17 views

More smaller scripts or less larger in Unity 2d Development? Better or worse performance? [duplicate]

In my unity 2d game I had large amount of scripts which were components of different enemies and obstacles. All of them were checking for collison, had FixedUpdate, Start and OnCollisionEnter2D and ...
user avatar
1 vote
1 answer
75 views

Check if a 90 degree rotation will cause a collision

I'm practicing Unity by developing a 2D game where the player has to stack tetrominoes falling from the sky. The problem I've ran into is that upon a 90 degree rotation of the falling piece, the piece ...
user avatar
1 vote
2 answers
144 views

Voxel terrain vs AABB collision detection

I am trying to implement collision detection in a voxel game. Currently I check the side of the collision by finding the closest side and checking whether there isn't a solid block next to that side. ...
user avatar
0 votes
0 answers
49 views

Optimal data structure for managing AABBs to minimize collision check queries

Say I have thousands of 2D Axis-Aligned Bounding Boxes (AABBs), and a single point. I'm checking whether a point is inside a certain AABB before performing some expensive logic. ...
user avatar
1 vote
0 answers
44 views

Character movement on irregular surface in Unity

I'm currently implementing a system in Unity where I generate an approximation of a blood cell and treat it as a planetoid, as if you're playing Super Mario Galaxy, and you're running around the ...
user avatar
0 votes
1 answer
62 views

How do collisions work under the hood in Unity? Is it more performant to make (physics) Layers as specific as possible?

I'm trying to decide how granular to be with my layers. I assume there's some spatial indexing going on, but... Does Unity do work for every pair of objects on compatible layers? Will Unity do some ...
user avatar
  • 143
0 votes
2 answers
139 views

Collision detection between transformed meshes (not primitives)

I know questions related to collision detection have been asked multiple times, but I find all of them like this and this depend on the assumption that I have some sort of measurement of the object ...
user avatar
1 vote
1 answer
87 views

Cannot properly get 2D top-down tile-based collisions

I am using HTML, CSS, and plain JavaScript for a 2D top-down tile-based simulation. I am trying to do collisions in which, for example, if I move up and hit the ceiling collision tile, I cannot ...
user avatar
  • 35
0 votes
1 answer
66 views

Why does OnTriggerEnter2D/OnCollisionEnter2D work when there is no other collider object opposite?

my bullet: There is a Box collider (checked "is Trigger") It has Rigidbody2D (Gravity = 0, freeze rotation Z) https://imgur.com/T4j1QoO I added the "OnTriggerEnter2D" function ...
user avatar
  • 13

1
2 3 4 5
48