Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to get the orientation of a surface?

Hey,

How could i get the "look at" angle of a certain part's surface? Imagine if I could just do this:

local rotation = part.Left.LookAt

And it would return me a Vector3 with the direction that surface is facing.

Any idea of how to do this?

1 answer

✓ Accepted answer

Okay so i think i know this.

U do dis:

local rotation = part.CFrame.rightVector*(-1) 

CFrame has dis 3 directions, the upVector the lookVector and the rightVector. To get the remaining 3 directions i think u just have to multiply by -1

6 comments

0

Haven't tried it as I ended up making my own solution, but sounds like it would work

0

I am trying your answer but now that i tried it i got a bit confused

0

What's the problem?

0

If for example i wanted to know the rotation of the right side how would i get it?

0

With the part.CFrame.rightVector u get a vector that points to where the right surface is pointing, so for example you could use it to move that part to it's right side

0

Got it, Thanks!

This discussion is preserved as it was. New answers, comments, and votes are closed.