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
11 views

Creating runtime mesh colliders for roads in Unreal Engine 4

I want to create several mesh colliders in game at runtime. By mesh colliders I mean "complex collision". The meshes are for curved roads. The roads will be rendered using hierarchichal instanced ...
0
votes
0answers
14 views

Pygame Tiled Map Object layer collision

I'm using pygame to make a top down shooter I've placed my tiles and object layers using Tiled Map Editor. My player and mobs collide with their spawn locations (object layer) is anyone able to help? ...
0
votes
2answers
11 views

Instantiated prefabs dont trigger ontriggerEnter while prefabs created not on runtime, do

I am new to unity and trying to make a bouble trouble game. I have enemy prefabs with BoxCollider with is triggered checked. I also have a shooting script. when I am trying to instantiate the enemy ...
0
votes
0answers
21 views

Using an objects velocity to determine if it falling on a player will kill it [duplicate]

I've been attempting to make a falling object kill a player, but i still want to make sure the player can touch and interact with the object to move it around without dying. The code i've made so far ...
0
votes
1answer
17 views

OnCollisionEnter2D and OnCollisionStay2D not detecting anything or being called unless i turn off 'Is Trigger'

I was attempting to create a simple button prompt where when you are inside a 2d box colider it will give you the option to press the button within that range, below is the short code used to test ...
0
votes
0answers
21 views

SAT Collisions: Resolving rotations

Currently I have a working 2D SAT collision system with only boxes, but works with static rotations as well, leaving room for triangles. One of the issues I've been able to resolve was tunnelling, ...
0
votes
0answers
28 views

Best option to narrow a known set of triangles?

I am building collision detection and response in a custom engine. This routine happens between the moving player, and static entities on the map. In the first phase, the broad phase I am moving the ...
0
votes
1answer
37 views

Check if point is inside convex hull

I first tried with a simple axis aligned bounding box to test my algorithm (later shape will be different but always convex 6 faces), but even this case did not work, it always tells me that the point ...
0
votes
0answers
18 views

My colliders keep going through one another? [duplicate]

So, I have some platform with colliders and a character with a collider (everything in 2D). The problem is, while there is some noticeable effects (a certain push back) when the colliders collide, ...
0
votes
0answers
20 views

Game Maker - Raycasting from camera in orthographic projection

I have been trying to figure out how to click on 3D objects in Game Maker Studio 2. I am using an orthographic projection. I know the basic idea is to calculate a ray that comes from the camera ...
0
votes
1answer
22 views

Collision quadrant in godot appears

I am learning to use godot following this video: Collisions with Autotiles The problem is that when I create the collision for the cliffs using tilemap, it appears me a blue quadrant indicating the ...
0
votes
1answer
33 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
0answers
7 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 ...
0
votes
0answers
13 views

How to handle grid based collision detection when one entity spans multiple grid cells?

While I do like the idea of quadtrees, I feel that they would be overkill for my game. So I want to use a simple fixed resolution grid for AABB collision detection. But I can't come with a cheap way ...
0
votes
0answers
26 views

(Gamemaker) SAT collision works, but need help with resolving collision that involves contact points

There are a lot of SAT collision tutorials for various programming languages, but so few for Gamemaker it's astonishing. Right now the collision detection works, albeit only using boxes. However, ...
0
votes
1answer
40 views

Super mario bros “rounded” tile collision detection

I'm working on a Mario bros clone with SDL and C++ (purely for educational porpuses / and for fun) I got collision detection working by using AABB collision detection and resolving one axis at a time: ...
0
votes
1answer
27 views

Player won't move correctly due to gravity force pushing him into the ground

I am making a tilemap platformer with pygame ad I defined the X and Y movement for the player and also a Y force that represents the gravity force to make it jump correctly. However, when my player ...
0
votes
1answer
38 views

Why does collision only work sometimes when there are multiple objects in the game?

when i was making a pygame in python for the first time i kinda have a problem where sometimes the player and the object would touch and the game would not close as intended i dint seem to find the ...
0
votes
1answer
31 views

Enemy gun won't aim properly when collision line is flipped | Game maker studio

When the enemy move's to the right their gun faces right. When they move left the gun will face left as it should. When the player collides with the enemy collision line on the right side, the enemy ...
0
votes
1answer
117 views

Wall sliding in JavaScript; works, but gets stuck at corners

this is a follow up to this other question: How do I handle player collision with corners of a wall In inspiration of the code given in its answer, I tried to write some new code. Basically, in the ...
0
votes
0answers
14 views

How to check if line of sight is blocked by a sphere? [duplicate]

Well, I'm trying to check that both players can see each other, and their line of sight is not blocked by a sphere(point with radius) Here is a simple 2D visualization Here is my code template: <...
1
vote
0answers
18 views

3D Binary Space Partitioning with solid/empty leaves

I've recently started looking into BSPs for real-time collision detection, and I'm now looking into improving the performance of my solution. The system that I've implemented is rather similar to the ...
0
votes
2answers
38 views

How do I sense when the player collides with a door in a GameController script?

I want to be able to sense when the player collides with a door from my GameController script. The player is a public GameObject and doors are tagged as such. Here is psuedo code for what I'm looking ...
0
votes
1answer
25 views

Improving Rigidbody collision between real-time movable object and other Rigidbodies

I have a cube that has been scaled to be rectangular (controlled by a remote Raspberry Pi gyro/accelerometer/magnetometer) and am translating its orientation into Unity via calls to ...
0
votes
1answer
50 views

How do I not let my explosion go through the walls like bomberman?

I have this problem that I want to fix. Every time I place a bomb it goes pass through the wall even if I added a Layermask to tell if it's a wall or not. ...
0
votes
2answers
36 views

transform.position returning wrong value (UNITY 2D)

I am trying to place the ball on the paddle until a key is pressed, also there is box collider that triggers if the ball falls down. For some reason the transform.position.y of the ball gameObject is ...
2
votes
0answers
39 views

Avoid shaking artifacts in 3D continuous collision detection

I am programming a 3D game physics engine that uses continuous collision detection to avoid my objects from being able to "tunnel" through the geometry. Here is basically how it works: Execute a ...
0
votes
1answer
43 views

How to make collisions occur between objects using the same script?

Well what I’m trying to do is have cars travelling on the road. The cars have a trigger at the front and a hitbox at the back of the cars. What I want to happen is when the trigger hits the hitbox it ...
0
votes
0answers
25 views

What's the best type of Movement/collision detection for high-Speed games?

Before I begin I'd just like to make it clear that I am not familiar with many programming/development terms, so if anyone can link articles to any terms used it would greatly help things move along: ...
0
votes
0answers
15 views

Sliding against a wall is “sticky”

I try to implement a ball sliding mechanism in my game. When the ball collides with a wall, it gets bounced. When it's close enough though (after many bounces) it will start to slide against it. But ...
0
votes
1answer
25 views

Categorize contact & overlap cases for 2D & 3D axis-aligned bounding boxes

My question is similar to this one. I want to determine whether two axis-aligned boxes are not only intersecting, but if they are intersecting and just touching on one edge or face, or if they are ...
0
votes
0answers
15 views

Speed after an angled collision?

I can calculate the speed when there is no angle, but I can't calculate the speed when it is angle. Physics paramaters: ...
0
votes
1answer
60 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. ...
0
votes
0answers
27 views

How to store 3D entity position, offset, and transformation data for parent and children?

I am looking for a cleaner pattern to storing character position data, offsets, and transformations. I currently have a character with a vec3 for position. ...
0
votes
0answers
16 views

Auto-generate optimal direction for Unity Raycast with specifications

How can I have a Physics.Raycast auto-generate a direction for itself to try to hit a given target through a restricted window of space? [Update] After much work, ...
0
votes
1answer
29 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. ...
0
votes
1answer
52 views

Unity: How to fix collision detection with fast moving objects in 2D?

I was making a simple pong game and it worked fine until I tried to increase speed of the ball. With increased speed ball moves across the walls occasionally. I've set no rigidbody for walls and ...
4
votes
3answers
1k views

Why is “collision” event needed when there is a “trigger” event?

The "trigger" event in unity is very flexible: it can be set to fire on both dynamic and kinematic bodies, as long as one of them has a collider with the "trigger" flag. On the other hand, the "...
0
votes
0answers
13 views

Overlap Collision on Box Collision only working on wireframe

When my player collides with the box collision instead of triggering while the player is overlapping the whole box it only triggers when I collide with the wireframe of it.
0
votes
1answer
18 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
0answers
47 views

Hitboxes in a Java game without rectangles

I left this question on "normal" stackOverFlow but they recommended I asked you guys! I am new to making games in Java but I made some games using the paintComponent method, however I felt like I was ...
0
votes
1answer
31 views

How do I get the player to collide with another object to use as a boundary?

I'm trying to make a simple game where you move a sphere from left/right and try to avoid falling cubes. If a cube touches the player (sphere), the player dies. I'm trying to set up boundaries using a ...
0
votes
1answer
51 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
136 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
0answers
19 views

How can I prevent two rectangles from overlapping?

I have two rectangles defined by their respective left, right, top and bottom. I'm trying to prevent the collisions for these two rectangles but I cannot find a working solution. I am obtaining the ...
0
votes
0answers
21 views

Capsule component lagging when using AIMoveTo

I`m currently working on RTS in space. All ships are with fixed Z value. When ship is created its placed on a plane (Floor) with collision set on blocking. Every ship is moved by selecting it and ...
0
votes
0answers
13 views

Collision Overlap not working in a Plane

I want to make all the objects that are overlaping my plane to be sliced! I can achieve this effect sometimes, but in some cases it does not work. Below you can see a situation where the collision ...
0
votes
1answer
100 views

How often should I check for collisions in a Miinecraft-like game?

I'm trying to build a game from scratch in Dart, similar to Minecraft. As far as I understood, there are two main functions in a general game loop: tick: a function that gets executed a fixed ...
0
votes
1answer
87 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
1answer
55 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... ...

1
2 3 4 5
45