Convert Origin Orientation to CFrame?

When working with Viewport Frames, I play around with the displayed Model in-game to figure out the Position and Orientation I need to use.

For example, I create the CFrame for the Model, -.25, 0),, -100, 0)) and then set the Model’s PrimaryCFrame to it viewItem:SetPrimaryPartCFrame(cFrame)

I’m able to just copy / paste the Vector3 Origin Position into the CFrame, and that works perfectly.
When I try the same with Origin Orientation, it gets changed when the game starts.

For example,, -.25, 0),, -100, 0) more specifically, -100, 0) gets changed to -47.94, 90, 0 as the Origin Orientation.

Might anyone know either a better / easier way to work with the Orientation?

1 Like

CFrame.fromOrientation() is this the constructor you’re looking for?

That seems like it could be useful, but is there a way I could still specific the position?

If you’re trying to move a model then MoveTo() takes a Vector3 value (which represents the position in the worldspace) to move the model to.

Ah I see what you mean, thanks!
I did just try using fromOrientation CFrame.fromOrientation(30, -2.5, 5), but this turns into -81.13, -143.24, -73.52 in game.

The in-game value is the CFrame value in its entirety, CFrame.fromOrientation creates a CFrame value based off the provided Orientation value (which is a Vector3). Hence the difference in component values.