I would like to get the orientation from a postion but i dont know how, is this posible?
I have tryed everything i could think of, (basicly just a whole bunch of combanions using mouse.Hit.position and stuff). Here is what i mean:
then i want to rotate the part to be aligned with the sphere mesh:
Is this possible? if so please help me by telling me a way to do this, Thanks so much!
One method you could use is this method, which allows you to rotate along the new up vector.
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.
…
Second method is this which also works,
The responses in this thread are incorrect. The surface normal is essentially a vector that points directly away from the surface.
One easy way of using this data is CFrame.new(part_pos, part_pos + normal). This will cause the object to ‘look at’ the surface normal, thus “aligned” with it. You can simply rotate this CFrame to orient it in whichever way you want relative to the surface.
Refer to thread: Explanation of Surface Normal?
Try both and see which best fits the behavior you need.