How to get orientation of model

Error i Get is PVInstance is not a valid member of Model “Workspace.Modelz”

Replace PVInstance with your model, sorry for the confusion.

1 Like

It keeps printing numbers that are not the orientation example
my models orientation numbers 34.393, 96.933, 12.148
it prints 0.6002667546272278

1 Like

it is still printing the position not orientation

1 Like

This is unlikely, it is likely returning the orientation in the format other than degrees, if you want to convert these values to degrees you can use math.deg.

I have tried this Devfourm already issue was I couldn’t rotate the model using the orientation ( it does print it out correctly though)

1 Like

Could you show me where you are rotating the model?

Sure!
Code

game.Players.PlayerAdded:Connect(function(plr)
	local m = game.Workspace.Modelz
	local X, Y, Z = m:GetPivot():ToOrientation()
	local OrientationY	= math.deg(Y)
	print(OrientationY)
	OrientationY += 24
	print(OrientationY)

When I add the 24 to the Y axis it doesn’t change in the properties or rotate it but it will print the + 24 to the y axis orientation.

This doesn’t show where you are setting the rotation of the model

What do you mean by setting the rotation of model? Here is a screen shot of the rotation hope this is what you mean?

What I meant was the line of code?

Ohh, the code I sent was the whole script (I am now second guessing myself that I wrote it incorrectly)

game.Players.PlayerAdded:Connect(function(plr)
	local m = game.Workspace.Modelz
	local X, Y, Z = m:GetPivot():ToOrientation()
	local OrientationY	= math.deg(Y)
	print(OrientationY)
	OrientationY += 24 -- wouldn't this add 24 to the y axis so it would move by 24
	print(OrientationY)
	

end)
1 Like

Are you expecting this to change the Y orientation of the model? To update the orientation of the model you need to use :PivotTo()

2 Likes

Like this? OrientationY:PivotTo(OrientationY + Vector3.new(0,24,0)) Still not working

m:PivotTo(CFrame.new(m:GetPivot().Position) * CFrame.Angles(X, math.rad(math.deg(Y) + 24), Z)
1 Like

If you don’t wanna go through the process of getting an orientation of a model, you can always set the model’s primary part to some part in your model and get the orientation of that. You can then weld all parts to this one primary part if you are trying to rotate an entire model.

This seems more complicated than actually doing it

Position is not a valid member of Model “Workspace.Modelz”

Sorry I edited the code it should work now

1 Like

You asked: How to get orientation of model
Is your real question How to change orientation?
Is this a model or a part?

What are you trying to do here? (in full)