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

How Do I make a part look at another part using Orientation and NOT CFrame?

Asked by 2 years ago

How do I make a part look at another part using Orientation? I am aware CFrame exists, but I DON'T want to use CFrame. I need to use orientation. Any advice?

1 answer

Log in to vote
0
Answered by
imKirda 4491 Moderation Voter Community Moderator
2 years ago
Edited 2 years ago

i am not sure if this fits your conditions, but this does not change the CFrame property:

local z, x, y = CFrame.new(origin.Position, target.Position):ToOrientation()

origin.Orientation = Vector3.new(
    math.deg(z),
    math.deg(x),
    math.deg(y)
)

:ToOrientation gives you the orientation of CFrame in radians, you need to convert them to degress using math.deg and i don't know why the order is Z, X, Y, no math genius as you can see.

0
ong you used cframe reported for misinfomition Xapelize 2658 — 2y
0
i'm so sory pls don't ban :c imKirda 4491 — 2y
0
ye plz no ban he didnt mean it :c T3_MasterGamer 2189 — 2y
Ad

Answer this question