CFrame.fromOrientation does not accept Vector3s

CFrame.fromOrientation does not accept Vector3s, which is what Orientations are stored as in most circumstances.

Because fromOrientation requires 3 numbers, and does not accept a Vector3, you have to unnecessarily complicate your scripts:

local part1 = game.Workspace.Part1
local part2 = game.Workspace.Part2
local part2_orientation = part2.Orientation
part1.CFrame = CFrame.new(part1.Position) * CFrame.fromOrientation(part2_orientation.X, part2_orientation.Y, part2_orientation.Z)

Expected behavior

Plugging in

local part1 = game.Workspace.Part1
local part2 = game.Workspace.Part2
part1.CFrame = CFrame.new(part1.Position) * CFrame.fromOrientation(part2.Orientation)

SHOULD “copy” the orientation of another part with no issue. But as it stands, this code will error as fromOrientation will not accept the Vector3 passed on from part2.Orientation.

CFrame.new supports Vector3s or numbers. I’d love to see this behavior mirrored onto fromOrientation.

1 Like

Thanks for the report! We’ll follow up when there’s any update on the issue.

2 Likes

Hi Ducks,
I took a look at your request. I agree with your assessment, it would be useful to add an additional version of .fromOrientation. Can you please file this as a feature request as nothing is currently broken.

Thanks

Sure thing! I wasn’t sure if I should have filed this as a feature request or a bug report. Ended up filing it as a bug initially because it simply “felt” like it. Especially since CFrame.new accepts Vector3s. I’ll close this up and turn it into a request. :slight_smile:

Moved to a feature request thread: CFrame.fromOrientation (or a variation of it) should accept Vector3's

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.