How to get contact points between a mesh collider and a line?
I have a game object with mesh collider on the scene. And I use mouse down and up got two points on the scene, so I have a line.
The question is How can I detect if the line and the collider contact, and what are the two points?
C#, Many thanks!
Answer by hexagonius · Feb 22, 2016 at 07:00 PM
you can use raycast from each point to the other. the result is a RaycastHit, telling this like position and normal. if you get no result, the clicks are both inside the mesh, if one, one is inside, one outside...
Got it! It is possiable to be done! But, wanna wait for other answers. See which may the best! $$anonymous$$any thanks for your help!
Your answer
Follow this Question
Related Questions
How to Make A Character Stop At Wall? 0 Answers
problem with tilemap collider and composite collider 1 Answer
Collision With Text 0 Answers
How to let a object dodge a collision? 0 Answers