Questions tagged [collision-resolution]

A process of adjusting game objects position after collision.

Filter by
Sorted by
Tagged with
0 votes
0 answers
21 views

3D Impulse based collision resolution not behaving correctly, what could be wrong?

I've implemented a collision resolution system based on Ian Mellington's System Cyclone and afterwards based on the Game Physics Cookbook. Currently the last one is implemented. For some reason the ...
Martin's user avatar
  • 1
1 vote
0 answers
32 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 ...
Jakob Tadej Vrtačnik's user avatar
0 votes
2 answers
64 views

Bouncing balls miss collisions, bounce the wrong direction, of lose momentum on one axis when hitting a corner

I am making a 2D game where balls bounce from the edges of the screen, However, there seem to be two types of issues with this kind of bounce method, and every tutorial I checked uses the same method. ...
ZozeR's user avatar
  • 42
3 votes
1 answer
68 views

How to make a CharacterBody2D slide out of StaticBody2D instead of teleporting?

I am trying to replicate Mario Maker's On/Off switches in Godot 4.1. In my current version, if the player got stuck inside the block after it was toggled on, the player just teleports out it. I know ...
Jason O'Neil's user avatar
0 votes
1 answer
108 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/...
shingo.nakanishi's user avatar
3 votes
0 answers
91 views

2D Tilemap Collision resolution in C#/MonoGame

A bit of context about my game: I'm nearly 2 years deep into development of my game called Cosmorists. It's programmed in C# using the .NET 7.0.11 framework, and MonoGame 3.8.1 game framework and it's ...
Stellar Roots's user avatar
2 votes
1 answer
160 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 ...
DyingIsFun's user avatar
  • 1,307
0 votes
1 answer
55 views

How to calculate angular momentum of two colliding bodies about their shared center of mass in 2D?

I'm following this guide to implementing collisions in 2D physics. It shows this diagram, but I don't understand how to calculate the values of Da and ...
noodle_run's user avatar
1 vote
1 answer
55 views

Player stays grounded when jumping at the side of a two tile high wall

I am currently developing a simple Super Mario Bros. like platformer in Cocos2d-x v2. I am now at the step of doing wall sliding with two axis-aligned bounding boxes (tiles) but I've not quite found ...
MikaKC's user avatar
  • 11
1 vote
0 answers
91 views

I don't want my plane to go trough walls, I want it to stop on obstacles

I'm currently working on my first Unity Learn code challenge, making a Flappy Bird style game where a plane needs to fly through gaps between wall obstacles. I've successfully implemented all the ...
Mila Data's user avatar
0 votes
1 answer
40 views

How can I prevent my ball from slowing down when it makes contact with the corners of colliders

I'm trying to make a game where the player has to destroy blocks. But when the player collides with the corners of the blocks, the player's velocity slows down, or even stops. How can I ignore the ...
Smizzles's user avatar
0 votes
0 answers
71 views

Sequential Impulses in 3D with friction

I'm currently writing a physics simulation in 3D, that uses sequential impulses. I've managed to implement normal impulses, but I can't get friction impulses to work. As I understand I first get two ...
xxnoflz's user avatar
0 votes
1 answer
72 views

How to separate player characters occupying the same board game space?

I'm trying to create a 2D "board game" type thing in Unity, and I would like each player to be visible within the same space. The way I want to do that is by having it so when a player ...
Konxovar's user avatar
0 votes
0 answers
46 views

Calculate direction to push player away from wall

I'm trying to write a common 2D game and using vectors for physics. I have 1 wall and 1 player object that can move diagonally (both are squares without rotation). When the player object collides with ...
ZAK's user avatar
  • 1
1 vote
1 answer
93 views

How to prevent colliders from knocking each other back before being destroyed?

For context, I have a player that can use a bow or a spear to shoot enemies in a 2D side scroller game. The bow shoots arrows and the spear shoots itself, and they both have rigidbody2Ds attached. ...
Peecee's user avatar
  • 13
0 votes
0 answers
35 views

OBB Collision Response (Rotational Elastic Collision)

I’m making a 3D physics simulator with OBBs and Sphere Colliders. I have all the collision detection and separation working, but I’m struggling with OBB vs Sphere collision response. I have it working ...
Ethan Cardus's user avatar
0 votes
0 answers
89 views

Why do my VR avatar's hands clip through my chair object?

I have spent hours on this task and I feel it's high time I asked. My avatar hands go into my chair GameObject. I added a box collider to the hands of my avatar and unchecked "Is Trigger". I ...
Craving_gold's user avatar
1 vote
1 answer
63 views

How to settle a rigid body to rest on flat surface

I am trying to simulate the behaviour of a rigid body, for example a cube, while it settles on a flat surface. Let's say it lends on an edge or even on a corner, and now it has to settle and remain on ...
Žarko Tomičić's user avatar
0 votes
0 answers
105 views

Box2D Lite demo by Erin Catto : How Baumgarte stablisation works with Arbiter and what "Allow Slope" means?

Hello Game physics developers, Hope you are having a good time. I am trying to write basic 3D box-box rigid body collison resolution. I was able to copy paste BIG BEEP formula to generate two impulse ...
Ankit singh kushwah's user avatar
0 votes
0 answers
48 views

Motion of a cube after it bounces off a floor

I am trying to simulate what happens when a cube hits the floor after free fall. I am considering a situation in which cube hits the floor with its edge. There is obviously reaction force from the ...
Žarko Tomičić's user avatar
1 vote
1 answer
187 views

How do I make multiple circles bounce of each other

How will I calculate the direction of the circles when they hit each other? (there is no change in speed, there is no mass, and all circles have the same radius) ...
dechire's user avatar
  • 13
0 votes
1 answer
161 views

How do you resolve continuous collision in a multi body system?

I've been trying to figure this out for weeks but every resource only provides answers for a single body. As far as I can tell for a single body you Find the time of impact Step up to that time ...
gjh33's user avatar
  • 1
0 votes
0 answers
53 views

Dynamic bodies falling onto static body tunnel through each other or fail to bounce

I have a problem with Box2D when 2 dynamic bodies fall onto a static body located below when their restitution is non-zero. They tunnel through each other instead of a rigid elastic bounce. If I treat ...
Simon Zvara's user avatar
0 votes
1 answer
165 views

How to stop player when they hit an axis aligned bounding box?

I'm in the process of creating a game using electron and HTML5. It's going to be a pretty basic story-based platformer, but I'm ...
Blue Herring's user avatar
15 votes
4 answers
3k views

Solving obtuse interior corner collisions

I'm having some trouble solving collisions in obtuse interior corners. In the above image, the black circle is the initial position, the red is the projected movement (straight into the corner), the ...
IanLarson's user avatar
  • 771
0 votes
0 answers
190 views

Rigid Body is rolling/spinning on collision, is there a way to have it slide on surfaces instead?

I have a rigid body with a sphere as a collision mesh which can move and rotate freely. It realistically spins when colliding with other objects, but this is annoying from a gameplay standpoint. Is ...
Mazz1224's user avatar
3 votes
1 answer
136 views

Is there a generic formula to determine the angle of deflection off of a rectangle?

I have a perfect 2D system, with no friction, elasticity, etc. A ball is colliding with a rectangle. I know the angle of the motion of the ball in degrees. I want to figure out how said angle will ...
user avatar
2 votes
0 answers
204 views

Transferring linear momentum to angular momentum in Godot

In Godot, when a 2D rigid body collides with another body, it seems that the force is absorbed/used to bounce back, but it doesn't give an "angular impulse" to the object, for instance if a ...
Pop Flamingo's user avatar
0 votes
1 answer
404 views

Get the closest point on an SDF

Is there a cheap and effective way to get the closest point on an SDF? (signed distance field). CodeParade made a video on a game he developed that uses SDF collisions with a sphere, how did he do it? ...
Creeper Cloud's user avatar
0 votes
1 answer
377 views

How to allow a CharacterController to pass through walls?

I'm developing a game in which bot-controlled billboards pursue you. If the bot gets stuck behind a wall for a while, not able to catch the player, I want the bot to pass through the wall. I'm using a ...
silver takana's user avatar
0 votes
2 answers
200 views

Changing falling behavior of my object after collision to go gradually down and not instantly

Context I'm here today to figure out how can I have an object to fall down after colliding to another object. In my case, I'm remaking Flappy Bird and trying to reapply some of the physics in place ...
Zeid Tisnes's user avatar
1 vote
0 answers
19 views

numeric inaccuracy collision resolution [duplicate]

I need an idea, please :). I've implemented moving AABB -> AABB collision detection (3D), returning the time of impact. When I calculate time_of_impact * velocity...
Aitch's user avatar
  • 111
0 votes
0 answers
50 views

Sliding convex polygon against other polygons

Is there a common practice for resolving polygon/polygon collision by sliding as shown in the image? The moving polygon is convex (and if it makes it any easier, a quadrilateral), but the polygons it ...
IanLarson's user avatar
  • 771
0 votes
2 answers
246 views

Cue ball direction after collision

I am trying to figure out the velocity of ball A after collision, which is V2.A as seen in the figure. I know that the velocity of ball A is perpendicular to the line connecting centre of ball A and B ...
ahmedkl's user avatar
  • 57
2 votes
1 answer
300 views

Movement system for thousands of entities

I want to implement a movement system for armies of multiple thousand units. However, I struggle to get the movement "stable" when there are more than a few hundred units. The problem: When ...
Gileos's user avatar
  • 23
0 votes
0 answers
534 views

Using a Raycast to stop the player from going through walls

I've been having this problem in the last couple of hours and I was just thinking if someone could help me figure it out, since I am unfortunately not a programmer, or at least a good one at all. I'm ...
mikeadam's user avatar
1 vote
1 answer
88 views

Rectangular Collision Resolution behaving incorrectly on corners

I'm currently writing a simple game engine and encountered an error while trying to resolve rectangular collisions. When an object moves diagonally and collides with a solid object I only correct it ...
Fundudeone's user avatar
0 votes
1 answer
139 views

How do I make soft tile-based collision?

I've done some simple tile based collision: Move character, look up the tiles moved into, and if solid, push them back out. I move on each axis independently, because this gets them to eject properly. ...
Lake's user avatar
  • 191
0 votes
1 answer
489 views

How to resolve swept AABB collision when two boxes are hit at exactly the same time?

I've read many posts here about sweeping AABB collisions and the corner problem. But I still couldn't solve the problem. In the image below, the object starts touching both boxes, and when I apply a ...
Noise Noise's user avatar
-1 votes
1 answer
408 views

javascript top down circle to circle smooth collision detection

I've been looking through a lot of answers here: Resolving Circle-Circle collision Circle to Circle collision, checking each circle against all others Nestling into contact with a group of physics ...
B''H Bi'ezras -- Boruch Hashem's user avatar
0 votes
1 answer
102 views

Problems with reflection angles during collision resolution between circle and rectangle vertices (2D)

I'm having a hard time trying to resolve the reflexion angles when the ball collides with one of the brick's corners (square vertices) in my brick breaker game. The collision detection system is ...
Andre's user avatar
  • 13
0 votes
0 answers
163 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). I'm actually trying to make my player (circle hitbox) ...
DarePhoenix's user avatar
0 votes
0 answers
190 views

How do I respond to AABB collisions?

I'm coding a physics engine in Javascript. Forces, Gravity, Friction, AABBs are taken care of. Now, the big question: how do I respond to AABB collisions? Right now, when an object collides, it prints ...
Andrey's user avatar
  • 1
0 votes
1 answer
181 views

Box2D make dynamic body fixed on the y axes

I working on a game project using C++ with SMFL and Box2d. I'm basically recreating the game "Jump and Hover", a simple platform game. In the game ther is an platform thats "hovering&...
Tal Brodkin's user avatar
1 vote
1 answer
461 views

Find closest open space in grid of rectangles?

I'm making a builder game where you snap arbitrarily sized rectangles into a 2D grid. I want the player to be able to drag and drop these rectangles anywhere on the grid, but prevent collisions (i.e., ...
Andrew's user avatar
  • 13
3 votes
0 answers
693 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 ...
Ciberman's user avatar
  • 135
0 votes
2 answers
349 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 ...
Ryan Peschel's user avatar
1 vote
0 answers
94 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 ...
Mia's user avatar
  • 11
0 votes
1 answer
78 views

Box2D & Processing - Collision location randomly assigned to center point

I am working on a particle simulation using Box2D with Processing. The setup: I generate 4 kinds of particles that exist in equal amounts (for instance 200 in total, 50 each). They are (for now) ...
wo_ste's user avatar
  • 11
1 vote
1 answer
191 views

How can I improve collision padding against level geometry in my 2D game?

I'm scripting my own collision logic for a 2D game that works like this: Boxcast in the direction of movement against appropriate colliders in the scene If a ...
Ginger and Lavender's user avatar

1
2 3 4 5
9