As some of you might know, I’m making a game that needs to spawn certain vehicles in various different positions. Of course I do not want all vehicles pointing into one direction, which is why I have been trying out various different commands to put into the command line that plays around with the CFrame of a vehicle model.
However, every time I tried using an orientation in a CFrame Code, it led to unexpected results.
My problem is that I can not use an orientation from a random part to rotate the model.
The forum didn’t help, as basically every rotation is included with fixed parameters, e.g.
CFrame.Angles(x,y,z) -- x,y,z can be replaced by any integer.
I tried using the following command to rotate my model, however it didn’t work as expected:
If your parts are welded (as noted above), also check your line of code. You are using “test” for Position and “testPart” for orientation. Are those supposed to be two parts? Can look at using PivotTo instead of setting the PrimaryPart directly. Can also use Rotation property of a CFrame as I did here:
CFrame.Angles applies the rotation in XYZ order. Basepart.Orientation has the rotation in YXZ order so you would use CFrame.fromOrientation instead, unless OP actually wants to use CFrame.Angles.
Looking at this, I assumed they just wanted to pass the orientation value’s components directly into the CFrame.Angles() constructor, in the same order in which the axis are defined (X, Y, Z).