x


Get Surface Normal at Point of Click

So here's a tricky one: When you use a mouseclick to create a raycast, and it hits a collider (including a mesh collider!), how can I get the outward vector at that specific point? So, for example, if I click on a model with a mesh collider on it, how can I get the surface normal of the triangle at the point where I clicked?

more ▼

asked Aug 02 '10 at 09:03 AM

qJake gravatar image

qJake
11.6k 43 78 161

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

If you're using an overload of Raycast with a RaycastHit parameter, you can just read hit.normal to get it

more ▼

answered Aug 02 '10 at 09:20 AM

Mike 3 gravatar image

Mike 3
30.5k 10 65 253

Guess I overlooked that when scanning the docs. Thanks! :)

Aug 02 '10 at 10:11 AM qJake
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1536
x122

asked: Aug 02 '10 at 09:03 AM

Seen: 1969 times

Last Updated: Aug 02 '10 at 09:03 AM