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
1answer
10 views

How to construct this collision vector?

I have a 3d game, but for movement I use only two axes (X and Z) - X is vertical, Z is horizontal Here's what I'm trying to achieve: Player is the circle, InputDirection is Blue, NewInputDirection ...
0
votes
1answer
29 views

Character blocking when walking on cube edges

I have my character walking on a ground made of cube. (scale 1,1,1). There is no space between them. Also, I have a RigidBody with 15 drag and I'm moving with <...
0
votes
1answer
30 views

Collision detection and solution causes teleportation on corners

I am making my own game engine on Python and I got stuck with collision between objects. ...
0
votes
1answer
24 views

OverlapBox() dimensions are huge but are fine when tested in isolation

To be completely transparent, I more-or-less copied this question from the Unity forums since I did not get a reply. I'm creating this system where I'm placing level chunks together and I need to ...
0
votes
1answer
15 views

Top-down 2D push angle velocity

I'm trying to determine the angle NPCs are pushed in when the PLAYER collides with them, like how 'Retro City Rampage' and 'Shakedown Hawaii' do when you bump in pedestrians. Here the PLAYER (green) ...
0
votes
0answers
39 views

chunk based collision

I have been trying to figure out why my collision tiles act so strange; I put I collision tile above a normal chunk based tile but it seems to not work - the collision tiles seem to appear in the ...
0
votes
2answers
59 views

AABB Collision Detection Confusion

I am trying to understand and implement AABB collision to learn simple 2D game physics. I'm following a tutorial and its method is a bit different to other websites. It uses the center of the object ...
4
votes
1answer
201 views

Making a wrapping wire (like the Worms Ninja Rope) work correctly with moving geometry

I have implemented a 2D wire like the one described in this question which is made up of straight line segments between wrapping points. However, while the algorithms described in this answer work ...
0
votes
0answers
18 views

Pygame Mask Doesen't Detect Collisions

I'm trying to make my game's collisions with masks. I have 6 masks but only 2 works. My code is: ...
0
votes
2answers
58 views

OnTriggerEnter With First Person Controller

I'm working on an FPS for my first time. I'm creating a simple terrain and instatiating 15 cubes on my terrain. (This works fine). Each cube is named "cube" and has a static trigger collider. Here's ...
0
votes
0answers
14 views

Collision2D on sprite child (sword of char) does not detect collision on tag == enemy

Problem is in the title. The sword sprite is a child of body which is a child of my char. Sword and Char have collider and rigidbody, and if the char and enemy collide, it works. But it does not ...
1
vote
1answer
29 views

How to prevent/“reverse” displacement from a collision?

In my game I can throw a hammer. The hammer moves based on physics in Unity. The hammer destroys the first object it touches. I want it to continue moving as though it didn't touch anything when this ...
0
votes
1answer
38 views

Why do my objects with colliders go through each other, and how do I fix it?

I am new to Unity and I am just experimenting with a player controller script (which I got off youtube) and another object which doesn't move. Both my player and the stand-alone object have colliders ...
0
votes
0answers
25 views

Box2D with SDL2 not working properly (Collision without rotation and problems with MKS)

I already have some expirience using SDL2 so I thought I will add a Physic Engine to my game - I chose Box2D. I managed to setup everything and to build a small program using SDL2 and Box2D. But now ...
0
votes
0answers
28 views

Odd Behavior with Simple Collision Detection Between Moving Objects, Rectangle Method

Solution Update After tinkering around a bit, I noticed that my bounding boxes were not updating in accordance with the movement of their respective objects, so it struck me that I should put the ...
1
vote
1answer
23 views

Unity Collider2D is causing the game object to disappear upon collision

I have gone through just about everything to try and isolate this bug. I have isolated it down to the enemy collider, but have not solved the issue. When my player collides with my enemy, the enemy ...
0
votes
0answers
20 views

Unexpected collision between two gameobjects [duplicate]

I can't find out why my Cube gameobject sometimes collides on transition right between two gameobjects (blocks), which are the same height, material and so on. See the gif below (note, the colors are ...
1
vote
0answers
41 views

Where and how should I check for collision in multiplayer game?

I'm making a multiplayer game. For now, I added a script to towers and I have booleans to change using OnTriggerEnter. When triggered, client sends a message to server and towers health starts to get ...
0
votes
0answers
30 views

Unity3d:Detect a collision between an image and a sphere

So, I just realized, an image with BoxCollider2D wont detect any collision with Sphere with <...
0
votes
1answer
26 views

How to make character not enter the platform when colliding on the side with the platform?

I had a problem with detecting my character's collision with the enemy being detected in 2 ways: side by side when it (character) jumps into the enemy's head. I imagine it to be basic, so I figured ...
1
vote
0answers
33 views

Problem with collisions detection on canvas platformer

Having a lot of trouble with my collision detection in my platformer. If you go straight to the right the block will float. Also the corners let the block sink right through and the walls are sticky. ...
1
vote
1answer
46 views

Is there a name for this algorithm for 2d shape collision?

A while ago I was considering my possibilities for implementing collisions between 2D shapes, and after much googling (which mostly turned up SAT), I came up with this: ...
2
votes
1answer
30 views

Creating a victory zone / Count units inside zone

So I am attempting to create a zone implementation where if the amount of units with a certain tag exceeds the number of units with another tag an objective will be captured standing in the zone will ...
0
votes
0answers
21 views

How to create polygonal or elliptical colliders by python tkinter?

I am developing a primitive game by python tkinter (I use canvas). It's not a big project. It's only my own self-challenge to create a game using only tkinter and standard python libraries. My problem ...
1
vote
1answer
87 views

Monogame - Collision not working and invisible walls

I have recently been experimenting with Monogame and XNA (moving from Gamemaker) and decided to work on a simple collision system. Problem is shown in the GIF. Main Collision Each entity (Quick name ...
1
vote
1answer
32 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
0answers
18 views

how to find point intersection of two segment in 3d after they collide? [duplicate]

I'm working on collision boxes project and I found a problem that when I detect the collision with the algorithm of SAT and knew that the collision was edge\edge I couldn't find the the point of ...
0
votes
1answer
36 views

How do I use trigger colliders in Unity?

I am trying to create a "Fruit Ninja" style game in Unity in VR. I have a BoxCollider on my sword set to "Trigger" and I have some "fruit" objects coming towards it. I then have this function: ...
1
vote
1answer
43 views

Unity Colliders - How do I detect nearby objects without my detection ranges detecting each other

How can I get both colliders' types in a trigger overlap message like OnTriggerExit2D(Collider2D other)? Example: ...
0
votes
0answers
13 views

making an SKSpriteNode collide with another SKSpriteNode through the use of a projectile image

i am having a lot of troublefiguring out why my projectile will not shoot the image of luke. I have tried many different methods to try and counteract this but none of the strategies have seem to ...
0
votes
0answers
37 views

Collision detection - formula for getting intersection point

I need help with collision detection algorithm from this paper: http://www.peroxide.dk/papers/collision/collision.pdf I assume I am colliding with sphere of radius 1, just to make everything not ...
0
votes
1answer
24 views

Gameobject stops moving or gets stuck when colliding with another GameObject

I'm currently making a brick breaker style game. My issue comes when the ball is launched off the pad it gets stuck in between two blocks. I have all the blocks on a "Foreground" layer with an "Order ...
0
votes
1answer
33 views

Unity Collider2D - Know the collider type ob the object collider with the other object

I have my GameObject which represents a soldier in my game. It has the following colliders: 1st BoxCollider2D in child named "sword". Is Trigger checked. Tag = Sword. This collider is enable when ...
1
vote
1answer
59 views

Voxel traversal for parabolic projectile arc under constant gravity

For linear polynomials, there's a bunch of algorithms for efficiently determining which voxels to test for collision (eg. A Fast Voxel Traversal Algorithm for Ray Tracing ). I'm having troubles though,...
0
votes
0answers
49 views

Can I detect collision on specific collider?

I'm a beginner with Unity and I'm developing my very first 2D game. My game character needs to have an automatic right/left movement but I'm struggling with the colliders on the walls (I made a ...
-1
votes
1answer
54 views

How to make player land on platforms more than one in pygame

I'm trying to make multiple platforms (blocks) on screen on which player can jump and land on it. When I just keep only one block, player jumps on it and land easily. But when I create other platform ...
0
votes
0answers
25 views

Check whether an object is fully inside/overlapped by other objects in Unity3D?

I have structures made of voxels (cube gameobjects), and I want to make complex structures from them. But I don't always want to place them on the grid. I want them to be more realistic, like ...
3
votes
3answers
290 views

Unity Round(Circle) Buttons

I have been using unity and C# scripting now for the past 2 or 3 weeks. So yeah i am very new to unity and C#. I wanted to know if there is a way to make a round(circle) button without using the ...
0
votes
0answers
66 views

something very strange in one of the collisions with OpenGL 3.3

As some of you know, I'm developing a game engine in C, and I came across a problem that left me kind of lost. When I was developing my collision system, I saw something very strange in one of the ...
0
votes
1answer
83 views

How to know which child collider triggered in parent?

I have parent object with 3 children. Each children has one collider (BoxColliders actually) marked as triggers each one. I want to know in a OnTriggerEnter on the parent side which collider was hit. ...
0
votes
1answer
76 views

Sebastian Lague 2D Platformer Controller 'Continue' Problem

In episode 10 of Sebastian Lague's "[Unity] Creating a 2D Platformer" series, he creates a jump through platform by using "Continue;" in his vertical collisions script. This worked great for a jump ...
0
votes
1answer
26 views

Error detecting collision with another instance of the same actor?

I have a project where after a certain time interval 2 NPCs are generated in different locations on the map. Each of them collides with a collision box that defines its "class" (red or blue): When 2 ...
1
vote
1answer
74 views

Minimal, unrealistic physics engine

I'd like to prototype a game with custom, very simple physics. Something similar to older games, anything from Super Mario to Quake 3 Arena. I'd prefer to avoid realistic physics engine because they ...
0
votes
1answer
20 views

Does collision detection data structures require a manifold mesh

Is it possible to apply spatial split techniques (oct-trees bsp-trees, etc) when meshes are not necessary manifolds? The mesh in question represents the "map". This means that it is static so spatial ...
0
votes
0answers
13 views

Pands3d. Get value of texture under mouse cursor

That's quite straitforward. While creating a technical demo, i encountered a problem, where i need to know color of textures under mouse coursor. As i see it, there must be a function to transform ...
1
vote
0answers
85 views

C# 2D game collision detection huge problem

I'm making my first game using C# and Monogame and I have a huge problem with collision detection. The entire code is in a link below: My game code So, I use Vector2 to keep position and dimensions ...
0
votes
1answer
48 views

Capsule to Sphere Collision

For my Maths unit at university, we have to manually calculate if a sphere is colliding with a capsule collider. The information I have to go with is this; You have the following Sphere: LadyBird3 -...
0
votes
0answers
16 views

How to tell what type an object is for collision-detection with a spatial partition?

I have been following this tutorial: http://gameprogrammingpatterns.com/spatial-partition.html that essentially creates a grid of cells. Each cell contains a doubly-linked list of ...
1
vote
1answer
109 views

What technique can I use to animate interaction between tiny objects in a sim game?

In simulation games like Sim City and Factorio, there are numerous interaction between tiny objects that needs to be animated. e.g. random people walking on the sidewalk, then waits for a bus, then ...
1
vote
1answer
43 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. ...