Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [collision-detection]

Collision detection is the determination of whether or not two or more entities make contact with each other during gameplay.

1
vote
1answer
20 views

How to make object that moves with constant speed not overshoot the object it collides with?

To learn LOVE2D I am creating a simple project. Player moves the square with arrows keys until it hits the goal square, at which point the game is won. ...
0
votes
0answers
6 views

How to detect collision direction in Phaser 3

Please consider this scene. Developed using PhaserJS 3. I want to make the slider move left when the player touches the right hand side of it, and move right when the player touches the left hand ...
1
vote
1answer
34 views

Should your world map have it's own collision object?

I am attempting to understand collision detection at the moment. I have seen many examples of a simple flat plane with boxes or cubes which move around on the plane and react when the touch each other ...
0
votes
2answers
58 views

Problem Implementing SAT Collision in 3D, OBB vs OBB

I am trying to implement SAT collision detection between 2 OBBs, however, I am getting a lot of false positives, can anyone help me figure out what I am doing wrong, thank you in advance. This is my ...
0
votes
2answers
25 views

how to detect touch on instantiated prefabs in unity

I have instantiated objects (that have collider2D attached) in a grid of 9x13. Now I want to detect a touch on each object ...
0
votes
1answer
29 views

Detecting collision between 2 rotated rectangles with limited parameters

Are there any function that can detect collisions between 2 rotated rectangles in javascript with this kind of information: ...
1
vote
2answers
118 views

Efficient collision detection of sphere with wall

I'm building a first-person game where up till now the player has been represented as a dimensionless point; this makes collision detection really easy, as I can just cast a ray along their velocity ...
0
votes
0answers
25 views

Update movement actor with collisions in 2D game

I have the algorithm for moving an actor. The actor has: 4 states: Stay, Move, Jump, ...
0
votes
0answers
24 views

Pygame Collision Problem

I'm making my first game of Pygame and I almost finished the collisions. But when the dog is felling I only lose when I press the up key. There isn't in the arrow up ...
0
votes
0answers
11 views

Collision Checking in Unity immediately after instantiation

I'm working on a dungeon generation script and I'm having some issues detecting overlap. Each piece that I spawn has attachment points, with rotation values and an offset amount so things lineup ...
0
votes
1answer
32 views

How to fix Corner Collision with SAT algorithm?

I am making a platformer game, my way of handling collision works most of the times, but when I jump on a platform's corner I get pushed away, it probably happens because my function returns right or ...
0
votes
0answers
91 views

Raycast collision Detection different results?

So I'm trying to make a collision detection system for a kinematic rigidbody for a gameobject but for some reason the results in which the gameobject stop is always different. I tried missing around ...
0
votes
2answers
52 views

Stop checking for the same collision

I am creating a JavaScript game that is currently implemented as follows: Run a game loop Check for arrow keys pressed When arrow is pressed, calculate the new player coordinates if new player ...
0
votes
0answers
16 views

Aligning a sprite with a tilemap

I'm trying to create a hybrid system for my Unity game. I want to use tilemap for collision and use sprites for the world. I drew a sprite onto a 40x40 checkerboard grid as can be seen here. I wanted ...
0
votes
0answers
35 views

How do I do collision detection in a 2d game using a tile grid but which also has pixel by pixel camera and character movements?

So I've been at this for weeks now and every solution I programmed did not work. I am using Free Pascal and SDL2. So I programmed a 2d game which uses a two-dimensional array which contains the tile ...
0
votes
1answer
49 views

How do I apply collision to a turtle

I cannot figure out how to apply collision to a turtle. I am in need of help for collision with pen lines and turtles. I want the two to hit and restart the game but I can't get collision on either. <...
1
vote
1answer
37 views

Character moving without control

i've been developing a third person adventure game on Unity with a grappling hook and i found a problem that i don't understand and it's driving me mad. Basically, if the player character collides ...
3
votes
1answer
126 views

Dodge different type of obstacles

I'm writing a 2D game where the player has to kill a Ninja. This Ninja is coming closer with a constant speed chasing the player. The Map has some static obstacles like stones no one can pass. The ...
0
votes
1answer
37 views

2d Character Crumbles after collision with platform

This is What Happens After Collision with Platform. when player jumps and collide Player gets Upside down or sometimes just on Back.any Help
0
votes
2answers
59 views

How to apply code of certain script to another?

I have a code in my "OnCollider" script to respawn whenever the player dies and has taken an object containing tag 'Respawn'. 1st script: OnCollider ; ...
0
votes
1answer
40 views

2D vehicle collision detection and rotation

I'm attempting to make a simple 2D car game from scratch, but I can't figure out the collision detection between a vehicle and a road. The vehicle should also rotate appropriately to its position on ...
3
votes
1answer
205 views

Workflow for authoring hitbox data for a 2D fighting/platformer game

I understand that collisions in fighting games are detected using hitboxes and hurtboxes associated with specific frames of the animation I am looking for techniques to author the data for these ...
1
vote
0answers
25 views

Issues With Buggy Collision Detection

I am working on a small game in Processing 3. Essentialy I have a small open-world game and I wrote up a enemy AI to make the enemies wander aimlessly back and forth around the gameworld, and chase ...
0
votes
2answers
19 views

Dividing properties between RigidBody and Collider

I am currently making a physics engine in Rust. The 2 main data structures concerning collision detection are: RigidBody: Physics-related aspects of the body. Contains a reference to a Collider ...
3
votes
0answers
33 views

How to implement path-finding with a large number of blocking agents following similar paths?

I want to implement a demo like creeps laning in Dota 2. So for simplicity, there is Left team and Right team, they are enemies. Units from Left team move toward Right base, and units from Right team ...
0
votes
0answers
15 views

How to check if moving OOB will resolve the collision?

I now (thanks to several questions that were already asked here) that I can use SAT to check if two OOB are intersecting or not. But what if they are already intersecting? My situation is: I have two ...
0
votes
0answers
14 views

A collider defined as intersection of two colliders

I'm working in unity and I have the following problem : Suppose you have an object that's very similar to say the intersection of say the corner of a cube and a ball, and you want a nice collider for ...
1
vote
2answers
58 views

Collision Detection in Direction (SFML) [closed]

I am experiencing a problem with collision detection, an efficiency problem. Right now I want to make it so that my player square stops traveling in the direction of collision into the static object. ...
0
votes
2answers
81 views

Pygame Collision Bug

I'm trying to add collisions to my first game, and it has a bug. My code is: ...
0
votes
0answers
90 views

How do I keep a rigidbody from making unnecessary collisions on smooth surfaces in Unity3d?

I have been having trouble with a custom character controller I am making. The root of the problem lies with collisions. I am trying to make movement code, but I have a problem with ground movement. ...
2
votes
1answer
53 views

Issues with AABB on a platformer game

i'm facing an issue at the moment in my javascript/html platformer game that despite searching for this issue i can't solve. The problem is this: When i place two platforms next to each other and the ...
1
vote
0answers
26 views

Handling strange physics behaviour while sliding between coplanar surfaces

We've got a character setup based around manually resolving collisions, and we're using bullet to do so. Our characters have a kinematic rigidbody to push things around, but their movement and ...
1
vote
1answer
56 views

Is Rigidbody needed and what move function to use in 2D games?

I don't really fully understand how to use rigidbody and which movement functions in a 2D game. There seems to be so many options and it's just a mess in my head right now. If I'm making a game like ...
0
votes
2answers
27 views

Particle spawn on collision spawns too many particles

So i have the following code: ...
0
votes
1answer
46 views

Dealing with curved lines in GJK

I'm currently using a GJK implementation (supported by EPA for penetration) and I'm trying to optimise the calculation times of distance calculations. One of the biggest hits is trying to solve for ...
1
vote
1answer
76 views

How to interact spheres with random walls

I have a physics problem to deal with, I am asking here because a game developers often uses the efficient method. I have randomly distributed circles interacting to through Lennard-Jones potential or ...
0
votes
0answers
14 views

Godot: How to maintain constant inertia

Inertia If I have a platform moving vertically I want the player to jump onto it without it losing its motion and slowing down or stopping. I have tried looking at the settings to CollisionShape2D ...
0
votes
1answer
60 views

Tile based collision detection errors if player is smaller than tiles

I have implemented a tilemap where each tile is at a non-negative x and y position. (So at the moment think like chess) At the moment a tile is 16, 16 pixels in ...
0
votes
1answer
30 views

MoveTowards object stuck with isTrigger Collider

I am trying to have a missile seek its target once it has entered the target's trigger. The code should be fine, I think it has something to do with how the colliders are operating. I want the blue ...
0
votes
0answers
24 views

Resolving this kind of situation in my platformer (movement on slope with roof)

I'm building a simple 2D character controller based on raycasts. At this moment I'm trying to finish the player-ground interaction. For the ground I will be using edge colliders and no tiling ...
0
votes
2answers
54 views

Why Some objects or prefabs don't respond to mesh collider?

I imported some assets and, I used some prefabs from that assets. Some of them responds when I add the component of mesh collider to it and disable the ability of going through with it. But some of ...
1
vote
1answer
77 views

Why do my NPC's fall through the world when I select them as triggers?

I'm making a game in Unity where when the player comes into contact with an NPC it will switch scenes. I have the code for it and made sure all NPC's have rigidbody as well as using gravity and convex....
0
votes
1answer
68 views

How would I move something around inside of a sphere without it going outside of the sphere?

I want to be able to do this, but not go outside of the 4.4 meter limit, the radius is 4.4 meters, and it has zero gravity and no friction. I have a hard time explaining this, but imagine holding a ...
0
votes
1answer
29 views

Unity Proximity Warning System Trigger issues

I'm trying to set up a proximity warning system but I'm having some trouble. To simplify things as much as possible: I have two game objects in a scene (Object1 and Object2). Object1 has a large ...
0
votes
1answer
85 views

Pygame Error AttributeError: 'pygame.Surface' object has no attribute 'add_internal'

I'm making my first game of Pygame. I'm going to create groups for making collisions but when I add an object to the group, I get an error in sprite.py (Pygame's Files) ...
0
votes
0answers
35 views

How to check collisions between rotated rectangle and a straight line?

How do I detect collisions between a rotated rectangle and a straight line?
3
votes
3answers
109 views

Collision detection in Arkanoid-like game at intersections

I'm creating an Arkanoid-like game from scratch. I have no (formal or informal) education of any kind in game-development, so I kinda made up things as I went regarding collision detection based on ...
1
vote
0answers
18 views

How to differentiate between colliding objects in Box2D?

I need to differentiate between different points of contact in my racing game. I currently have staticSensors which determine if the car is on the track or not, but I have created a second sensor to ...
2
votes
0answers
40 views

Support function of Minkowski Difference

I am watching this and if you stop at 7:25, you will find an implementation of the support function. The goal of the function is to give you the farthest point in a given direction. My question is how ...
2
votes
0answers
18 views

Unity - kinematic rigidbody character calling OnCollisionEnter and OnCollsionExit on every frame for specific collisions

I'm encountering an issue with my character collider behavior. I have several elements that are relevant to this issue: a "character" gameobject (capsule mesh), that is assigned with a kinematic ...