Questions tagged [collision-detection]
Collision detection is the determination of whether or not two or more entities make contact with each other during gameplay.
2,460
questions
0
votes
0
answers
13
views
Collision between a sprite and a rect in PyGame
I'm trying to make a simple platformer game, which has code to move the camera towards a player as they jump around.
Now I have two classes: one for the player, and one for the platform.
In the ...
0
votes
2
answers
50
views
How to check if an AABB is colliding or the mesh itself
I have the following problem. I would like to check in bullet whether only the AABB collides or the mesh collider itself. Unfortunately I can't find out how to do this
Within the screenshot you can ...
0
votes
0
answers
51
views
Enemies not registering hits from the player in Godot
I am making a 2D game where the player can attack enemies using a designated Area2D node as an attack area. I set up signals to manage attack phases and ensure ...
1
vote
1
answer
52
views
Issue with AttackArea Monitoring Before Attack in Godot 2D Game
I'm developing a 2D game where the player character can attack enemies using a designated attack area (Area2D node named AttackArea). I've encountered a problem where the AttackArea is active and ...
0
votes
2
answers
62
views
How to implement rigidBody movement and collision in local axis X while moving the body automatically in local Z axis?
I'm making a very peculiar outrun clone. I need the player to move forward automatically while being able to change his position on the road in his local X axis.
I made infinitely generated road and ...
0
votes
1
answer
57
views
Particle system won't collide with box collider all the time. Rain seeps through ceiling
I'm trying to make it rain in my game, but am having a problem with it seeping through the ceiling. I put a box collider above the house to catch the rain as it falls and it worked for a while, but ...
0
votes
1
answer
50
views
How to add gameTime to movement with acceleration and diagonal normalization?
I recently started rewriting my engine from scratch, because the old one was my first attempt and the structure was very messy. Everything has been going great, but now I'm being held back by some ...
1
vote
0
answers
52
views
Swept AABB for 3d collisions
https://www.gamedev.net/tutorials/programming/general-and-gameplay-programming/swept-aabb-collision-detection-and-response-r3084/
So I was following the tutorial above to implement swept aabb for ...
0
votes
0
answers
44
views
How to align to 2D ground surface directly underneath?
I'm out of ideas at this point.
I'm trying to set up a function inside my player controller that aligns the player with whatever is under it (usually the ground), ive tried using Raycasts, collisions ...
0
votes
0
answers
62
views
SAT-based collision resolution in case of edge-to-edge collision
I am trying to implement a SAT-based collision detection and collision resolution system.
Collision detection seems to be working correctly, but collision resolution behaves weirdly when there is edge-...
0
votes
1
answer
35
views
How to check for collisions between objects with the same script?
I am creating a game where there would be two objects instantiated. Each one has a script (to check for collisions), a Rigidbody2D component and a ...
0
votes
1
answer
52
views
Identifying the wall of impact during BSP traversal
I'm building a 2D BSP based physics game and am having trouble implementing what might seem like an easy feature. I'm using Gamemaker as the basis for this project.
Basic Info and Point of Impact ...
0
votes
0
answers
41
views
Collision matrix is set to have no interaction between layers, but collider still triggers
I wanted to set up the layers that my Player interacts with, but it still triggers with unwanted layers. I have disabled the whole collision matrix in project settings:
Here's my Player settings:
...
0
votes
1
answer
186
views
Detect collisions with both parent and child nodes in Godot
Using Godot 4.2.1, I have a 3D scene with a CharacterBody3D as the root. It has two children; a child CollisionShape3D, and a child CharacterBody3D with its own collision shape.
...
0
votes
0
answers
41
views
Differentiate between Triggers in OnTriggerEnter Unity
I want to implement a simple functionality in my Unity application:
I have a water volume represented by a Tilemap with TilemapCollider2D.
I have a player that has 2 triggers: 1 in the center of the ...
0
votes
1
answer
58
views
Bounding Box/Rectangle collision glitches
I've been working on this golf game for a couple of weeks and have been trying to create a reliable collision system for whenever a golf ball (mini golf) hits a block. I'm using regular rectangular ...
0
votes
0
answers
73
views
Pixel platformer character collides with blocks above while there's still a visible gap
I was trying to the set up a tile map for a 2D pixel art game in Godot 4.1 (following a tutorial) and realized that there seems to be an issue or something I am not aware of with the way collisions ...
0
votes
0
answers
51
views
Managing multiple collisions in a single frame
I have a object with box collider that spins 360 degrees before destroying itself. I have a lot of enemies spawning around the player. The object spawns, spins and destroys itself. Imagine it like ...
1
vote
0
answers
48
views
Separating axis theorem implementation results in limitless extending colliders along the Z axis
I am trying to implement SAT and it works except for the fact that colliders extend infinitely along the Z axis and I can never get past them. I also have confirmed that ...
0
votes
1
answer
131
views
Seperating axis theorem is bugged
I am attempting to make split axis theorem for 2d collision physics. It does works, but is inaccurate. It is based off of: https://www.gamedev.net/tutorials/programming/math-and-physics/a-verlet-based-...
0
votes
1
answer
40
views
OnCollisionStay outputs strange contactpoints
I am currently trying to make a pen draw on a paint.
I am searching for contact points on the paint but there is too much contact points than expected.
I'm not sure to properly understand how ...
1
vote
0
answers
39
views
How to fix collision for objects beyond their green lines?
As you can see in the image those are collision lines but its kinda of disingenuous as there are I would say invisible collision blocks on the X's, I tried messing around with the sorting layers and ...
1
vote
1
answer
344
views
Area2D only detecting body_exited once
I am new to game development, I am practicing by creating a pong game.
I currently have an Area2D set up with a signal listening for ...
0
votes
1
answer
110
views
Test if a point is inside a 3D cuboid, given the 8 corner positions, through code
I'm trying to find to obtain if a point, let's call it "v" is inside a cuboid which every corner position named P1 to P8
I am trying to achieve this and in fact found some answers in some ...
0
votes
1
answer
199
views
How can I change scenes when the player touches another CollisionShape2D in Godot 3.5?
I need to know how I can change scenes in Godot 3.5 when the player touches another CollisionShape2D.
I've tried this:
...
0
votes
1
answer
108
views
How can I make colliders-only visible in Godot?
Specifically, I'm looking for any way to see a collision-only item from a Mesh Library in a GridMap. (The tag says "tile map", which it technically isn't; but there's no option for a grid ...
0
votes
0
answers
83
views
Brick Breaker - Adjust ball's collision angle without affecting speed
I'm working on a Java Brick Breaker game, and it's functional so far. However, I'm facing an issue with collisions. Currently, when the ball collides it simply reverses its direction.
I want to ...
0
votes
2
answers
100
views
How does unity refer a to a normal when there are so many?
When an object collides with another object, does unity calculate the normal, or return it from the list of normals?
0
votes
2
answers
60
views
How do I detect a hit by a swung held object?
I have an XR Grab Interactable wrench and the grab is working fine, as is movement. I'd like to use it to smash some chains, so I figured that I could use an OnCollisionEnter on the chains, and check ...
0
votes
2
answers
95
views
Detecting collisions with trajectories
What if an object were to have collision detection implemented as so: A ray in the direction the object is moving in, and a ray in the direction of gravity.
0
votes
1
answer
118
views
Why check the ball and brick collision twice?
I watched https://www.youtube.com/watch?v=F86edI_EF3s.
I believe the following code is the complete code
https://github.com/games50/breakout/tree/master/breakout13
And
https://github.com/games50/...
0
votes
0
answers
18
views
Does unity transform world to local considering rotation
I want to implement oriented collision in unity as a test, and for convenience I just wanted to know if local space is also based on rotation. I wanted to check at least two objects against each other ...
0
votes
0
answers
75
views
How is terrain collision handled
GJK can be used for all shapes but what if the points in a figure aren't indexed, then how can we get the Minkowski space by adding the correct pairs of points even though we don't know them, and also ...
0
votes
1
answer
52
views
Why are the transform game objects moving away from the snail when they are swapping their direction?
I am making a game in which I created a character (main player) and another character(snail). Now the snail will move on the ground, when there is no ground detected it will change its direction. I ...
0
votes
1
answer
18
views
Change of computing power/ time needed when imported Mesh triangle number changes
I am doing a Unity project, that makes it necessary to import a mesh consisting of triangles.
As it is possible to reduce the amount of triangles in a mesh and keeping the structure similar, I am ...
0
votes
1
answer
85
views
Time aware point -> capsule swept collision detection?
the simplicity of Minkowski sums are one of the big reasons capsules are used in collision detection, especially for player models. One of the benefits of this should be the ability to perform ...
0
votes
0
answers
57
views
Decrease size of hitboxes for a sprite in PixelPAD
I need to make the hitboxes of spikes smaller, so that it's not impossible for the player to get through. How do I do that?
2
votes
1
answer
258
views
Character controller that can handle sloped terrain and boxy ledge traversal
I am working on a character controller for a 3D platformer in Unity. I cannot find an approach that satisfies me.
I have experimented with these approaches in order to learn about their virtues and ...
0
votes
0
answers
31
views
Casting out vision rays for 2D car in pyglet to return distance from objects?
I am working on a machine learning project that involves training a 2D car to drive around a top-down racing track. I'll be training neural networks using different algorithms and one essential form ...
0
votes
0
answers
37
views
how to get all points contained in the area of an object of any shape
how would I get points contained by objects, so that I can check for intersections of points, and I also ask myself if checking for intersections each frame would be too CPU intensive?
0
votes
1
answer
146
views
The bottom of the player capsule collider is going into the ground box collider
The bottom part of the player capsule collider is going inside the ground collider. I am using a raycast for detecting whether the plauer is grounded; an object (sphere) that is present on the bottom ...
1
vote
1
answer
183
views
Detect intersections between an `AABB` and a `CollisionShape3D`
I thought this would be a simple matter of getting the mesh that defines the CollisionShape3D and checking if any of the triangles of the mesh intersect with the <...
1
vote
1
answer
75
views
Bullet not colliding with either plane or drone
i made a godot game in which theres a player and a drone, I got the shooting to work but when i tried to make it so that the bullet attacks the drone/player, it wasnt working properly. Basically i ...
1
vote
0
answers
96
views
How to get OnTriggerStay2D working?
I am trying to make a flamethrower weapon for my player character. I am using a system were I can change between weapons, and every other weapon works perfectly. The flamethrower is able to turn on ...
0
votes
1
answer
135
views
Trying to calculate hitbox vertices for my game and adding SAT collision
I am currently working on a basic HTML, CSS, and JavaScript game as a freshman high school summer project. I am currently trying to implement separating axis theorem (I spent a lot of time learning ...
1
vote
1
answer
39
views
Platformer Sprite is inside of a Solid Sprite
My platformer sprite in Construct 2 works normally aside from it not colliding correctly with platform sprites that are solid, as it goes through them until the platform is not quite halfway up the ...
0
votes
0
answers
59
views
Physics2D.OverlapBoxAll misses small overlap
I have a tetris-like 2D game with tiles, each made up of a sprite, a Rigidbody2D and a BoxCollider2D.
The tiles fall from the ...
0
votes
1
answer
180
views
Physics.OverlapBox not detecting 2D collider objects
I have a 2D game with several square objects (tiles) that each have a BoxCollider2D and a kinematic Rigidbody2D. I want to detect when one tile is located to the right of another tile, such as to ...
1
vote
1
answer
448
views
falling and clipping through terrain
I found this bug in many big games and never expected to find it in my small game. Basically, while running around carelessly, you suddenly clip through the terrain and fall endlessly.
I momentarily ...
0
votes
1
answer
192
views
How to check if a 2D GameObject is touching something without OnTriggerEnter
I want to avoid using OnTriggerEnter2D because I want to use it in a function like this:
...