Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to get the orientation of a surface?

Asked by 6 years ago

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

Log in to vote
0
Answered by 6 years ago

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

0
Haven't tried it as I ended up making my own solution, but sounds like it would work LollipopCraft 1 — 6y
0
I am trying your answer but now that i tried it i got a bit confused LollipopCraft 1 — 6y
0
What's the problem? Kiriyato 15 — 6y
0
If for example i wanted to know the rotation of the right side how would i get it? LollipopCraft 1 — 6y
View all comments (2 more)
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 Kiriyato 15 — 6y
0
Got it, Thanks! LollipopCraft 1 — 6y
Ad

Answer this question