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 to (i.e. normal to; i.e. at a 90 degree angle to) the surface at that point.
[image]
A Vector3 is named 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 posi…
This is answering the literal title of your post.
IT’S MATH TIME!
Part of what is returned by a raycasting operation is a normal vector, which is a directional unit vector that faces straight out of whatever face was hit by the raycast.
If you simply want to find the side of the part we hit, we can compare the normal vector we hit to the vectors that make up the face normals of the part and return the face for the given side.
This leaves us a question: how would we compare two vectors to see…
Getting the corners of a face is a bit more messy since you would need to know which Axis to use maths on, i’m lazy so i don’t know any easy way but i would just code 6 different axis calculations to get the corner of any face.
this is the image i always refer to whenever i need to get the corners of a basepart.
https://images-ext-2.discordapp.net/external/2GsFJHd-N6zdLu0BdOWjj4B7KZBhhIQ3TtO0vyE4JIo/%3Fwidth%3D1009%26height%3D676/https/media.discordapp.net/attachments/932657144191414303/941875705925476402/6b6f081efba33170e35eb80346909228.png
EDIT:
don’t exactly understand the intention of the OPs code, from what it seems you want it so the player can only climb the corners of an instance
3 Likes