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

How to get the exact hit position in Minecraft Forge/MCP?

I am working on a project for Minecraft. I want to figure out exactly where a player was hit. For example, I want to be able to display a particle effect exactly where the player was hit (like chest ...
0
votes
0answers
20 views

Weird Collision Response occurring between 2 objects

I have been trying to program collision response between two objects (with AABBs) and the response is not what I except. Instead of bouncing off (reflective to the collision normal) each other the ...
0
votes
0answers
19 views

Unity: how to make a kinematic rigidbody react to a rigidbody hitting it?

How do I make a non-kinematic rigidbody react to a "normal" rigidbody colliding with it in Unity? Like when the rigidbody hits the non-kinematic one, it pushes it back (note: not using the ...
0
votes
0answers
35 views

Compute normal of collision between two bodies, when multiple fixtures touch

I have a body made of multiple fixtures. Sometimes, when another body collides with it, Box2D detects contacts between more than one fixture. The figure illustrates this: the blue body is made of two ...
0
votes
0answers
14 views

How do get fast leaf nodes collide with a leaf node in bvh tree. ( I don't wanna traverse top-down )

How do get leaf nodes collide with a leaf node in bvh tree. I wanna leaf node list collide with a leaf node in bvh tree. I'm doing this traversing bvh tree from top node. But It really slow because ...
0
votes
1answer
24 views

Unity 2D - Raycast not colliding with collider in very specific circumstances

I've been trying to work out what could be causing this bug for days now but can't figure it out for the life of me. I'm trying to make a fish avoid the walls of it's tank in a Unity game I'm creating ...
0
votes
1answer
45 views

Problems with collision order of resolution

I have two objects, A and B, and I need help to solve the following problem about the collision resolution order: A and B are moving with the same speed, and they don't move both at the same time A ...
0
votes
0answers
12 views

How to find the center of mass from CapsuleCast in unity

Is there an easy way to find the center of mass from a CapsuleCast, or should I find the geometric center of it?
0
votes
1answer
64 views

Best practice for detecting enemy death in 3D platformer

I'm building a 3D platformer, and I'm having issues figuring out how I should determine whether the player has effectively jumped on an enemy to kill them. My current approach uses "hurtboxes&...
0
votes
2answers
54 views

Collision filtering in Box2D: running out of bits

I have a physical simulation on the streets of a city. The simulation is 2D but in a few points it could develop on multiple "layers": for instance bridges or underground tunnels. I may have ...
1
vote
1answer
37 views

How to prevent GameObject from moving?

I am making a pong game and here's the problem. The ball hits the enemy paddle and instead of reflecting the ball just takes the paddle with it. Ball Brains - ...
-1
votes
2answers
80 views

Rectangle collision not working!

I'm making a simple game in C# and i'm having some problems with rectangle collisions. What i'm doing is checking if two rectangles intersects, checking the side of collision and then moving the ...
0
votes
0answers
19 views

Rigibody2D remove push-power

I have a player's prefab. The game is online, so when the player joins I place this prefab on the map. There are other players on the map. The player himself is controlled by Rigibody2D component ...
1
vote
1answer
81 views

How does a game like slither.io handle collision?

This question can be generalized to "how does one efficiently determine if a collision has taken place between curvy lines" On https://slither.io there are snakes that players play as that ...
0
votes
0answers
39 views

How do I expand my simplex in Expanding Polytope Algorithm (EPA) when the origin lies on it?

I'm doing GJK + EPA in 2D for collision detection + resolution. For GJK, I was using the vector (1,0) as my first support direction. However, if the origin happens to fall exactly on the simplex line (...
0
votes
1answer
43 views

How to detect when a shot hits the opponent from behind?

I'm making a game where the enemy can turn on its own axis in 360 degrees (top view game). The player-controlled character has a bow. With this bow he shoots and deals damage when he hits the enemy. I ...
0
votes
1answer
36 views

Pygame logic to make a player stop at obstacles without overlapping them

what's the best logic to force the player to change its direction when he's just next to an obstacle (building, rock, tree..) ? I know this is related to collision detection but maybe my logic isn't ...
0
votes
0answers
31 views

Why does Lerp not reach target if setting rb.position, but setting rb.transform.position works?

I don't understand the logic here. I have the following script which makes a player jump towards a target: ...
1
vote
1answer
90 views

Can't check collision between a mask and a rect in pygame

I'm new to using masks in Pygame and I'm having trouble with them. I have already learned how to check collisions between two masks but I'm wondering about an effective way to check collisions between ...
2
votes
0answers
51 views

2D game make precise collisions

I am currently creating a personal 2D tile map game in Java. This is the first time I have attempted to make any sort of game, so I don't have a lot of techniques known by experienced developers. ...
0
votes
1answer
28 views

How can I create a good physics colliders for these models in Unity3D

I need to make a 3D colliders in Unity with those forms. I don't want to use any Asset Store asset if it's possible. There are two models: both are cylinders but they have some deformations (see image ...
0
votes
0answers
43 views

Unity OnTriggerEnter2D doesen't check Z Axis

I am coding my game's collisions using onTriggerEnter(). The problem is that it only checks X and Y axis and not the Z one, and that is causing me some problems ...
0
votes
0answers
28 views

How can I "tilt" my grounded raycast?

I'm working on a 3D game with a spherical collider for the player. My ground check looks like this, where I'm currently hardcoding Vector3.down as the direction: <...
0
votes
0answers
21 views

Player catches on tile map collision, even with common fixes

I am making a simple 2D platformer in Unity. I have a tilemap and I started noticing that the player catches on the tiles during gameplay. I move the player using ...
0
votes
0answers
67 views

How do I reference specific child objects in OnTriggerEnter2D

I'm currently trying to check if child objects, whose parent is running the script, are colliding with things. It doesn't matter what they're colliding with on the layer, I just want to know which of ...
0
votes
1answer
55 views

Issues using Physics2D.Linecast for Movement Collision

It's quite possible I'm missing something obvious (I'm still rather new to this) despite checking the documentation, but I'm at my wit's end with this issue. I'm attempting to add simple linecast ...
2
votes
1answer
124 views

Floats vs. Ints for position and collision

So I’m writing a player class and using floats to store the positon and velocity (Vector2) as well as using it when drawing. When it comes to collision I get the player bounds using this code: ...
0
votes
1answer
22 views

How to detect all vertices within collision Area?

Using collision detection algorithms such as MPR (Minkowski Portal Refinement), GJK (Gilbert–Johnson–Keerthi distance algorithm), you can calculate the penetration depth in the collision. For 2 mesh ...
0
votes
1answer
27 views

Pygame some methods aren't working properly (collidepoint and get_rect)

I'm making a game menu in Pygame, consider the following block of code: ...
0
votes
0answers
9 views

one collider for 2 combined object

I have an obstacle that composed of 2 game object, but when the player collides it, it gets in OnTriggerEnter twice when the obstacle have 2 different collider, which is what it should be, of course. ...
0
votes
0answers
38 views

Sphere-ring collision detection

I'm making 3d basketball throwing simulator and I'm stuck with the sphere-ring collision detection. It's easy to find the collision normal if we have the collision point with the ring, but I don't ...
0
votes
1answer
73 views

What is get_bounding_rect() method in Pygame?

I got used to get_rect() when detecting collisions in Pygame but I've just discovered that another method called ...
0
votes
0answers
58 views

How to detect ray cast collision on terrain gameobjects?

I made a script were an objects shoots a ray cast facing on the vertical axis and detects were the terrain is and then moves to the current terrain height wherever it is. This is so I can spawn an ...
0
votes
2answers
99 views

Why can't the player walk properly on the moving platform?

I'm making a platformer with Unity. In one of the scenes, I have a moving platform that moves back and forth. The problem is that the player can't walk (or sometimes jump) properly on the platform and ...
1
vote
0answers
79 views

With Unity, why this character with a rigid body and child element colliders doesn't collide with the floor and go through it?

I got an issue with my character going through the ground and actually going through all other elements with a collider. I'm going to try and show as much as I can of the current state of things. My ...
1
vote
1answer
51 views

Instantiated entities don't collide with each other

I've started to learn DOTS some day ago, and decided to create a simple project. When I added some simple physics to the game I faced the problem. I added one object on the scene and another ...
0
votes
0answers
144 views

Box collider not colliding with Character controller

I have a player with a CharacterController attached. The player can move around. There are obstacles which the player can collide with. These obstacles have a ...
2
votes
1answer
116 views

Creating walls for a racing game?

I have the following kind of race track: As you can see some walls are talls but some aren't... Question: How can one create invisible walls so that cars stays in track? More exactly, how to model ...
0
votes
0answers
37 views

Unity Job System - Transform movement but checking collision with wall

I am trying to get this Unity Job System to work on my top-down shooter 2D game I am currently using transform.position to move player around. I can do it in the ...
-1
votes
1answer
47 views

How to stop player from slingshotting across my game window

In my pygame dungeon rpg when my player collides with a wall at the top or the bottom of its rect and I move the player in either x-direction, the player gets slingshotted off the screen. Using print ...
1
vote
0answers
79 views

How can I allow the rope to correctly interact with Box and Polygon colliders?

In order to build 2d rope physics in my game, I download the github project from Jongallant in this link. In my game, I want the rope to collide with objects with different types of colliders such as ...
1
vote
1answer
67 views

How could I simulate projectile collision agaisnt RTS units with primitive colliders?

For example, humans are easy they are just capsules. But for cavalry, an arrow could hit the horse or the rider. Right now cavalry are also capsule colliders for unit-unit collision, but for ...
1
vote
1answer
49 views

How to compute the points of a CollisionPolygon2D?

Godot v3.3.1.stable.mono.official I am trying to draw a CollisionPolygon2D programmatically but I cannot resize or write the ...
0
votes
1answer
31 views

Detecting a mouse click While in a Trigger

Why does the following code not working? (weird, sometimes it works sometimes not ) I want to move player by touching on the screen and change the color of gameObject when detect trigger and release ...
1
vote
1answer
107 views

Unity 'Collider.bounds.Intersects'. Does it handle rotation?

You will probably laugh at my code here (and I would love to hear some completely different approaches to this problem if possible), but I've written this myself using the only logic I could come up ...
0
votes
0answers
39 views

How would I implement a level transition when reaching a cave in Raylib?

I am the developer of an upcoming 2d/3dRPG. I have a simple scene setup where there is a bridge over some acid and a cave entrance-like thing that I want to change the level with. I have used C and C++...
1
vote
0answers
37 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
26 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
38 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
27 views

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

Consider this: * KinematicBody2D - * Sprite - * CollisionPolygon2D And a vertex shader: ...

1
2 3 4 5
47