Share Your Experience: Take the 2024 Developer Survey

# Tag Info

## Hot answers tagged collision-avoidance

### Fix my Flow Field pathfinding

I had a similar problem this week, so I thought I'd post what I did. Dijkstra's algorithm is inherently discrete, so it will always give you directions that tend to funnel everyone into the same few ...
Accepted

### Movement system for thousands of entities

Myself, I'd solve this with a combination of flow field pathfinding and local avoidance. First, the flow field: for each army, initialize a graph of map locations spanning the army and their goals (...
• 135k
Accepted

### How to prevent cube intersecting with other objects when moved around with mouse?

I can think of three different approaches to your problem. One involves using an object silhouette or shape as a preview of where it's going to be placed; another is a real-time positioning of the ...
• 4,831
1 vote
Accepted

### Ensure a path always exists between moving objects

Note: I am not looking for any type of cooked solution, just some references to existing algorithms, implementations,... to look into by myself. A noteworthy algorithm here is Velocity_obstacle. Its ...
• 2,571
1 vote
Accepted

### Collision avoidance not only AI wrong

I found out logical mistake, I should do the sum of angles as totalAngle and then divide it by the count of angles so I get ...
• 243
1 vote
Accepted

### How to make one box Collider 2D go through another in Unity?

You should use Pyhsics2D.IgnoreCollision() since Box Collider 2D inherits from Collider2D, not Collider. Found more info here, check this one out.
• 537
1 vote

### Unit collision avoidance for RTS

You are on the right track. I have re-implemented collision avoidance for my RTS taking Recast as example. General approach is quite simple: Each agent (that's how they call units in collision-...
• 10.7k
1 vote

### given the position and velocity of an object how can I detect possible Collision?

The dot product has two nice properties for collision avoidance. The dot product is closely related to the cosine of the angle between two vectors. The dot product of a unit vector A and a second ...
• 4,067
1 vote

### 3D collision avoidance: finding the updated velocity vector (outside the "collision-velocities" cones)

I don't think there's an efficient way of solving the problem exactly, but here's how I'd try to tackle it. First, I'd use bounding volumes around each object, instead of the objects themselves. Each ...
• 301
1 vote

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

You're not handling line endpoints correctly. Consider only a single line segment. The collision of a circle at the endpoint of a single line segment should be rounded, right? Like, if you trace out ...
1 vote
Accepted

### Intersecting ORCA lines finding non-optimal solution for fast units

Okay, I've found the problem, and it was written in the original paper, which I missed among all other papers apperantly… I mean, there were tons of papers about it, that, for some reason I never ...
• 11
1 vote
Accepted

### How to prevent collisions between instantiated prefabs

I ended up using the suggestion of @allnodcoms to use layers. I queue up a full generation to be simulated on 16 separate layers using a SimulationManager. Although ...
• 141
1 vote

### Collision detection and solution causes teleportation on corners

I found solution. First of all I made collision detection function for readability, then I made collision for each axis apart. ...
1 vote
Accepted

### Dodge different type of obstacles

I made it :D Using A* with time dimension. Creating the obstacle paths just one time, on cast. Then i simply do A* and on neighbor check i check for the time the spot would have as well, if a spot is ...
• 161
1 vote
Accepted

### Enemies overlapping

This is a very common problem in AI pathfinding, and you generally have three possible solutions: Accept the overlap. But this is far from ideal. Queue your enemies. Detect a collision, and stop the ...
• 2,649
1 vote
Accepted

### Vector field collision avoidance

So yeah... I solved my problem... I was normalizing the vector from the enemies before adding it with the original direction, and this creates a step too big between "no collision" and "collision".
• 145
1 vote
Accepted

### How would I go about implementing a collision avoidance check, avoiding moving objects from multiple directions?

The first thing to do with any large collision sets is elimination. Range check in itself is a good start but another check is simply a direction check. Is the direction the asteroid in this case ...
• 1,150

Only top scored, non community-wiki answers of a minimum length are eligible