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
0answers
22 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
50 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
31 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
30 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
40 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
50 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: ...
3
votes
1answer
33 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
31 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
108 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
41 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
19 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
38 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
75 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
15 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
41 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
26 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
36 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
65 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
107 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
67 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
30 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
532 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
69 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
136 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
120 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
32 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
93 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
21 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
15 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
92 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
81 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
18 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
115 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
50 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. ...
1
vote
1answer
216 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
78 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
130 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
95 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 ...
-1
votes
1answer
199 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
195 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
33 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
16 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 ...
1
vote
1answer
57 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
145 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
3answers
106 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 ...
1
vote
0answers
70 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
51 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
269 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
70 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
148 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 ...