The CFrame documentation is mega flawed

Lets look at some of the constructors.

CFrame.new() -- Position and LookAt

This constructor needs to be deprecated. With the introduction of lookAt and lookAlong, it has been made entirely useless and confusing. More so by the fact taht lookAt is possible with .new(), but lookAlong is not. It needs to be deprecated so that beginners are pointed towards the .lookAt constructor instead.

CFrame.fromEulerAnglesXYZ, CFrame.fromEulerAnglesYXZ
With the existence of CFrame.fromEulerAngles(), in which you can specify the Enum.RotationOrder, the existence of these two constructors comes down to how convinient it could be debated it is to specify the Enum.RotationOrder, which I’ll admit isn’t something you usually do when constructing a CFrame. This one isn’t the most heinous on the list.

CFrame.Angles()
This one is ridiculous. It is the less scary word, and is probably going to be someones first choice, as it’s pretty simple “Yeah it’s to give my CFrame rotation”. The problem comes from the fact that EulerAnglesXYZ exists. Now a beginner is left wondering the difference. This would not be a problem if perhaps it was the only one that was in use, and the other constructors were listed as deprecated, but there really is no real guidance on the documentation as to why you would use one over the other, that being because there is no pros or cons! It’s confusion which could be solved via deprecation, deprecation in the name of clarity.

CFrame.fromOrientation
Even more heinous. Why is this “from” Orientation, while angles are just “Angles”. Perhaps ```CFrame.fromAngles" would’ve aided this, and we can probably just chalk that up to not knowing the future, afterall Orientation is a CFrame property and can’t be indexed as a function. Regardless, confusion again, especially where “fromOrientation” differs from another function which does the exact same thing, just for another Rotation order of EulerAngles. A nightmare for beginners to traverse.

CFrame.fromMatrix
Now, this one is tricky. I think constructing a CFrame matrix from .new() makes sense, because all CFrames are evaluated to a matrix at the end of the day. The real stickler here is instead of passing 12 numbers, you’re passing 4 vectors. .fromMatrix doesn’t even accept 12 numbers, it only accepts the 4 vectors, there is no overloading here. Again, confusion, especially as for a beginner, the “matrix” of a CFrame is probably the most daunting term.

Now I understand, all the information is on the docs. you can spend as much time as you want learning how the constructors work, and I also know you can’t just remove the functions. However, something needs to be done, especially in regards to the Rotation constructors. In my opinion, it’s a rabit hole of quaternions, eulers so on and so forth, which you realistically don’t need to do for what you’re likely trying to accomplish in your project.

I’d love to hear about anything you all have to say in disagreement, but this is just my opinion as of now.

4 Likes

Haha glad to see another person who has the same opinion.

I even made a discussion post on it to rant on the topic as well.

From what I learnt its mostly due to historic reasons such as the CFrame.Angles one.

https://devforum.roblox.com/t/deprecate-cframeangles/3071742/33?u=dthecoolest

This goes the same for this method CFrame.fromEulerAngles() as I have only seen this recently.

Nothing we can do but highlight the issue, inform others on the devforum, and wait for roblox to update their documentation.

Oh wait a minute I believe they open sourced it now we could change it when we have the time.

2 Likes

:pray: glad my first reply has some brains behind it

1 Like

I’m pretty sure this one is deprecated (which is why it has no lookAlong support); it only continues to exists for backwards compatibility since the other methods didn’t exist.

The old documentation site had a warning displayed for that specific overload stating that CFrame.lookAt should be used

2 Likes

Yes, to my knowledge they deprecated, and then un-deprecated it.

1 Like