x


default cylinder to indicate hit.normal

How do you align a default unity cylinder to indicate the hit.normal vector in a raycast?

more ▼

asked May 05 '11 at 07:52 AM

ina gravatar image

ina
3.3k 492 548 597

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

1 answer: sort voted first

I haven't tested, but wouldn't this work?

cylinder.transform.rotation = Quaternion.FromToRotation (Vector3.up, RaycastHit.normal);

more ▼

answered May 05 '11 at 08:36 AM

loopyllama gravatar image

loopyllama
1.5k 1 4 18

no that gets the parallel to surface

May 07 '11 at 03:45 AM ina

nvm it worked! (child object, the arrow had been set at 90 degree off, in trying to get a previous hack to work)

May 07 '11 at 04:58 AM ina
(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:

x2155
x1525
x193
x161
x124

asked: May 05 '11 at 07:52 AM

Seen: 1344 times

Last Updated: May 05 '11 at 07:52 AM