CFrame of the
This function is equivalent to the following.
Note this function will throw an error if no primary part exists for the
Model. If this behavior is not desired developers can do the following, which will be equal to nil if there is no primary part.
local cFrame = Model.PrimaryPart and Model.PrimaryPart.CFrame
Rotating a Model
The following code demonstrates how GetPrimaryPartCFrame and SetPrimaryPartCFrame can be used to rotate a model.
A simple model is created in the Workspace and a loop is started that will rotate the model 10 degrees around the Y axis every 0.2 seconds.