Obi Official Forum
Help Finding Rope existence on mouse click - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html)
+--- Thread: Help Finding Rope existence on mouse click (/thread-4253.html)



Finding Rope existence on mouse click - kripa1415 - 13-06-2024

Hi,
 Is it possible to find if there is any rope exists on mouse clicked position  ?
 something like Physics.OverlapSphere() by passing position and collision radius ?


RE: Finding Rope existence on mouse click - josemendez - 13-06-2024

(13-06-2024, 08:37 AM)kripa1415 Wrote: Hi,
 Is it possible to find if there is any rope exists on mouse clicked position  ?
 something like Physics.OverlapSphere() by passing position and collision radius ?

Hi,

Yes, you can use spatial queries for this. They give you a lot of information regarding all particles overlapped by the shape.

Note that once you get particle index/indices from the query, you can retrieve the actor it belongs to by looking it up in the solver.particleToActor array.


RE: Finding Rope existence on mouse click - kripa1415 - 13-06-2024

Ah okay Thanks!. Its working.