1
\$\begingroup\$

I'm simulating shooting by raycasting. I want to instantiate a bullet hole or mark on the spot where a bullet hits an object. But the surface of the object at that point may have different angle or direction:

example

How can I find the object's surface direction to make the right transform for a bullet hole?

\$\endgroup\$
2

1 Answer 1

1
\$\begingroup\$

The direction a polygon is facing is called its "normal". Thus, you want to get the normal at the spot hit. Raycasts return that information: https://docs.unity3d.com/ScriptReference/RaycastHit-normal.html

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .