bleintant
(bleintant)
September 29, 2023, 8:53am
#1
I’ve tried to research this but still haven’t found a clear cut answer. So, what does the normal mean/do? Every time I print my normal it just seems like some random coordinate. Not only that, but when I create a part at the raycast Normal, it’s always near/at the origin. Can anyone clear this up for me?
dthecoolest
(dthecoolest)
September 29, 2023, 9:59am
#2
The surface normal is a vector, which can be imagined as a description of an arrow in 3D space.
In the example given by @jody7777, the arrow is a representation of the vector that is perpendicular (aka normal aka at a 90 degree angle to) the surface at that point.
[image]
A Vector3 is described as such because it is a vector with 3 components, normally (x, y, z). Now let’s say that the length of the arrow in the above image is 5 units. It is shown to be pointing straight up, in the positive-…
I believe you are confusing raycast result position with raycast normal in this situation.
An example use of case of raycast normal is to orient a part with the ground:
Rather than trying to convert this up vector into an angle which is also complicated it’s better to leave it I would rather use @EgoMoose advanced CFrame technique to leave it in terms of vectors.
We can obtain a CFrame rotation to align the current persons “UpVector” to the new surface upvector. Here is an example script and video.
The advantage of this method is that it will allow you to rotate along the new upVector without having to specify a right vector as a CFrame.fromMatrix solution.
…
1 Like
bleintant
(bleintant)
September 29, 2023, 10:00am
#3
From the sources you’ve sent, it seems that raycastNormal is a direction, not a position, right?
dthecoolest
(dthecoolest)
September 29, 2023, 10:01am
#4
Yes that is correct it is a direction vector
1 Like
bleintant
(bleintant)
September 29, 2023, 10:02am
#5
Alright, thanks, I understand now.
I love getting the occasional notification that my reply from over 4 years ago is still getting linked to haha! Hope it helped @bleintant
1 Like
system
(system)
Closed
October 20, 2023, 4:08pm
#7
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.