- Home /
detect if two objects in a list intersect in editor.
Hello! I'm looking for information, but I can't find it ... everything leads to colliders, and what I don't want is that. I have multiple lists within a class, within a script, to identify new mesh and work on them.
Currently in each list, I have points, which are vector3.
What I would like to know is how I detect using vector3.distance, if two vectors approach.
example, point1 of list 1, approaches point 5 of list 4.
I have a code, but it doesn't work properly.
code:
for (int i = 0; i < roadCreator.shapes.Count; i++){
for (int j = 0; j < roadCreator.shapes[i].points.Count; j++) {
if (Vector3.Distance(SelectedShape.points[info.pointIndex], roadCreator.shapes[i].points[j]) < roadCreator.handleRadius){
Debug.Log("creado");
break;
}
}
}
I thought it would work that way, but it doesn't ...: /
In this way I am learning how to generate mesh intersections ...
If there is any other idea of how to make an intersection between points, it would be nice to read your personal opinion!
any ideas?
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Splitting a Mesh into Submeshes 2 Answers
Simple plane generation 1 Answer
Weird bounce on collision with perfectly aligned (generated) meshes for fast object 3 Answers
Procedural Mesh Editing Performance 1 Answer