CFrame.fromOrientation (or a variation of it) should accept Vector3's

As a Roblox developer, it is currently too hard to construct CFrames using Orientation values from parts and other objects. This is because CFrame.fromOrientation accepts only 3 numbers, and not a Vector3, which is contrary to how Orientations are usually stored in almost every use case.

For example, the following code will error, because part.Orientation is a Vector3:

Part.CFrame = CFrame.new(Part.Position)*CFrame.fromOrientation(otherPart.Orientation)

Currently, this is what you have to do in order to construct a CFrame from an Orientation:

Part.CFrame = CFrame.new(Part.Position)*CFrame.fromOrientation(otherPart.Orientation.X, otherPart.Orientation.Y, otherPart.Orientation.Z)

This is, of course, just an example of fromOrientation’s short comings. There’s work-arounds, such as doing otherPart.CFrame.Rotation, but in some certain cases you may store a Part’s Vector3 Orientation or otherwise. I’ve also run into the issue quite a lot when working with CFrame math related things. As it stands, there is no way to plug in a Vector3 into any CFrame math and have it be treated as a standard Roblox Vector3 Orientation.

If Roblox is able to address this issue, it would improve my development experience because it will make working with standard Roblox Orientation Vector3s and CFrame math much easier.

(Originally posted as a bug report here: CFrame.fromOrientation does not accept Vector3s)

9 Likes

You can do this to get the same exact result

Part.CFrame = CFrame.new(Part.Position) * otherPart.CFrame.Rotation

Well aware- I mentioned this in the OP. There’s workarounds but in some cases you end up storing the Vector3 Orientation of parts. For those cases I’d prefer an easy way to apply a Vector3 Orientation without having to read/apply each individual coordinate of the Vector3.

3 Likes