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
2answers
382 views

How to flatten the collider for a tilemap?

I am relatively new to game development, and am working on a simple 2D platformer. I have created a tilemap and painted some tiles for the character to walk on.. but he is getting stuck. Yes, I know ...
0
votes
1answer
2k 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
172 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 ...
0
votes
1answer
19 views

Unity How to detect if a 2D object overlaps any other 2D objects

I am programmatically placing 4 large dots on my 2D scene which already has some objects on it. If the new dot overlaps an existing object I want to destroy the existing object. All the objects have ...
11
votes
4answers
2k views

Fastest 3D collision detection between two oriented bounding boxes (OBBs)

I am at the point in my game where I need to add a collision system. I tried jBullet, and while it did work, it wasn't what I was looking for. I just want a simple way to test if two oriented bounding ...
0
votes
2answers
95 views

What's the maths behind checking line of sight

I understand in unity there is Phsyics.LineCast(Vector A, VectorB). What's the maths behind doing that, the only thing i can think of is going along the line at small intervals and seeing whether it ...
0
votes
0answers
50 views

How to Implement One-Way Slopes?

I am working on a 2D platformer in Unity and am doing my own collision detection. I was previously using the method described in Sebastian Lague's popular YouTube tutorial, where you break your ...
0
votes
0answers
20 views

Exact collision time of two axis-aligned bounding boxes

I am trying to calculate the exact collision time of two axis-aligned bounding boxes (aabb) as fast as possible (in the sense of CPU time). I have all the required information (aabb min, max, center, ...
0
votes
1answer
33 views

Swept 3d capsule intersection with AABB, what am I actually supposed to use to accomplish this?

I'm trying to figure out how to do continuous collision with a capsule (which would represent a collision volume for a player for example). Given how common the capsule is in many game engines, and ...
0
votes
1answer
55 views

How can I destroy particles on collision with specific a GameObject?

I wrote a script to manage my Particle System emission. The starting lifespan is set to infinite so that the particle never dies until it reaches a specific collider. I didn't find any method to ...
0
votes
1answer
964 views

XNA 3D Unable to Position Bounding Sphere

I have a collision method that seems like it would work, and it does, but the bounding sphere is always at 0, 0, 0. How do I fix this? Any more code and or details are available upon request. ...
0
votes
0answers
30 views

Ray vs AABB (2D) reporting hits

I've been working a 2D ray versus AABB implementation. I worked it out on paper, then read about a popular "branchless" algorithm. I decied to try the branchless one, but it gives me ...
2
votes
3answers
12k views

How to stop objects pushing each other away on collision?

I'm creating something along the lines of Super Smash Brothers. There's a problem with the collision between the two players and projectiles. We have rigid body on the characters and projectiles and ...
0
votes
2answers
997 views

Dragging a Rigidbody2D without passing through obstacles

I have this body of code written for an object that needs to be an obstacle and another object that is draggable. I have colliders on both and a kinematic rigidbody on the draggable object, but the ...
0
votes
0answers
19 views

What does “ShapeRenderer.ShapeType.Filled”, “ShapeRenderer.ShapeType.Line” and “ShapeRenderer.ShapeType.Point” do in libGdx

I am creating a game and I wanted to include collision detection when I came across this: shapeRenderer.begin(ShapeRenderer.ShapeType.Filled); What is this and ...
0
votes
1answer
66 views

Zoom into character upon collision

When a character collides with an object in my game, there is a slow motion effect. That's coool, but how would I zoom into a sprite when it collides with another object? Here is my code currently... ...
3
votes
2answers
2k views

Using collision.contacts to determine if on a floor

I'm trying to make my own first-person character (because I get lost in the sea that is Unity's FP character script), and am trying to make it so it detects when it is standing on a floor. I tried ...
0
votes
1answer
35 views

What is the best way to check if a moving 2D object will collide with another immobile one before reaching its destination?

Provided that both objects have rectangular hitboxes, x and y positions and height/width, what is the best way to check if a moving 2D object will collide with another immobile one before reaching its ...
1
vote
1answer
39 views

Determining first voxel ray intersects

I'm trying to implement the Fast Voxel Traversal Algorithm on a uniform grid of axis-aligned rectangles. Having read the paper, I understand how the traversing works, but not the initialization. I've ...
0
votes
1answer
128 views

Collision between a player and a solid block C++ SDL2

I am trying to implement a collision between a player and a solid e.g. a solid box. ...
1
vote
1answer
46 views

How do I stop a moving object when colliding with a static wall or falling to a static ground

I'm writing my very first 2D game engine in C++ and SDL2. I wrote a very simplistic RigidBody class that computes the resultant force, applies forces and simulates ...
0
votes
2answers
124 views

libgdx - Problem occurring after collision detected

I have just implemented collision detection in my little 2d rpg-like game. I'm using Tiled for the maps, mechanism is simple - I have one layer called 'collision' in my tiled map, and while loading ...
0
votes
1answer
46 views

How to move player out of multiple penetrating colliders?

The player in my game can teleport like Noctis from ffxv.The player shots a weapon projectile and then teleports to the projectile. I'm using raycast to calculate the weapon position after thrown. ...
1
vote
1answer
98 views

In a top down game, once I have detected collision, how do I prevent it?

I'm making a top-down game in Java. I watched some videos, and this is the code I currently use when the player is colliding with an object: x += -velX y += -velY ...
0
votes
1answer
46 views

Unity Springjoint2d - how to put collider between anchors?

I want gameobjects to bounce off a line between 2 springjoint points. I placed boxcollider2d (with small Y scale) or edgecollider2d between two Joint points and every frame put it in right place, set ...
1
vote
1answer
55 views

Find the co-ordinates of collided objects in Python

I have a group containing my aliens and another containing the bullets I have fired. When I detect their collisions, I want to pull the alien's x-y co-ordinates during it's deletion so I can put an ...
0
votes
1answer
1k views

Unity Mesh collider not working with capsule collider

I have in my Unity3d Project a capsule that represents a character and has a Rigidbody and capsule collider as components, and in my project I also have a mesh that is my terrain imported as fbx from ...
2
votes
1answer
577 views

3D line segment AABB collision, with hit normal?

I'm embarrassed I can't find this, but I'm wanting to detect intersection with a 3D line segment (not an infinite ray) with a 3D AABB, the AABB being defined as two Vec3f's which represent the Min and ...
1
vote
1answer
645 views

Game Maker Studio - Check Collision With Subimages

I have an obj_roulette, which contains 4 subimages, with value 2-5 and image_number 0-3. The ...
1
vote
1answer
184 views

How to prevent a sprite to move in an angle that will lead to collision

I have two sprites that can move in any angle. The sprites are rectangular. I created bounding boxes for both the sprites. These boxes rotate whenever the sprite rotates. They always surround the ...
0
votes
1answer
285 views

Collision Detection in Pygame

I'm making a game where the main character is a cat and has to avoid dogs and eat food. The collision detection works for the dogs and will subtract a bar of health from the cat, but when the cat ...
1
vote
1answer
121 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
35 views

Issue with 2d Angular Car Collision Response

I am having trouble getting the angular collision response to work properly in my 2d car simulation. I have gotten the linear collision response to work between the vehicles, however, the angular ...
1
vote
2answers
504 views

Java - Collision detection (Glitch)

I am working on a platformer game for the final year project in HS. However... The collision detection system I use is basically about checking wether a specific part of the character intersects with ...
0
votes
1answer
68 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
62 views

How can I create a pressure pad in order to open a door?

I'm making a 2D platformer with Unity. I want to create a pressure pad in order to open a door and I want the door to open when the player is on the pressure pad and close in few seconds after the ...
1
vote
1answer
95 views

Colliders slightly intersecting each other; any solution?

Consider this simple scene: In Unity, colliders slightly intersect each other. Typically, this isn't a problem. However, I want to make a custom character controller using a box collider and not a ...
0
votes
1answer
55 views

Creating Complex Collision Shapes in GMS2

I'm pretty new to Game Maker Studio 2 and I've hit a wall in programming with their built-in physics engine. I created a irregularly shaped object and I want to modify the collision shape so that it ...
3
votes
2answers
141 views

How do I convert OnCollisionEnter2D to OnMouseDown?

I created a simple animation. I have a "Gamer" object, which I move and hit squares to destroy them. Squares I have to destroy in the right order ...
5
votes
2answers
469 views

Collision detection problem in XNA4/Monogame

I have been trying to get 3D collision detection working for a while and I think (hope) you people can help me. For my project I have created a 'sprite3d' kinda class which is called ...
3
votes
1answer
587 views

Can't make sprite collide with tilemap made with Tiled

I'm a newbie who just started learning phaser. I have created a tile map with Tiled. It is composed of two tiled layer: background & collision. In collision layer I put some walls. And in the ...
0
votes
1answer
1k views

Collision Player and Tilemap Unity

i am a student in austria. I am working on a project for school, where we have to make our own first game with unity. Because it is the first time using unity, i constantly run against problems. Most ...
0
votes
1answer
40 views

Player hitting bottom of tile when beside it?

So my player checks if it is colliding with tiles, and it works pretty good. However, when the player is against a wall, moving upwards and sideways, it detects it as hitting the bottom of the wall ...
0
votes
2answers
216 views

How do i manage skill collision target in Unity?

I wanted to make a skill that can be used by both Player & Enemy. How do I make it such that the skill will not be colliding with the owner/caster or colliding with both? One stupid way I have ...
2
votes
1answer
167 views

How to implement angled surface?

I'm trying to implement 2D platformer game inspired by N game. But the problem is I have no idea how to implement something like this: and I have two ideas of how this could be implemented, but I ...
0
votes
1answer
133 views

Topdown Game Collision Detection

I am working on a simple game with topdown movement, but I am unable to get the collisions to work properly. I know the collision detection itself works, but the constraining of the player is where I ...
0
votes
2answers
214 views

How to use separating axis theorem to allow for sliding along walls

I'm making a 2D platformer game and using the separating axis theorem for collision detection, but I want the player to be able to walk along the ground and slide on walls and other stuff and I can't ...
0
votes
2answers
37 views

How to detect intersections with only colliders and not use the physics engine?

I do not want to use the physics engine, I only want the collider to detect when they have entered into another collider, then I want to handle what happens to the objects. Moving static colliders (...
0
votes
1answer
112 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 ...

1
2 3 4 5
46