Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How would you rotate a model?

Hey guys. I have a question that needs to be answered: How do you rotate a model? I have tried the following script and put it inside a model, but it only MOVES the model, not ROTATE it.

function TransformModel(objects, center, new, recurse)
	for _, object in pairs(objects) do
		if object:isA("BasePart")then
			object.CFrame = new:toWorldSpace(center:toObjectSpace(object.CFrame))
		end
		if recurse then
			TransformModel(object:children(), center, new, true)
		end
	end
end
local Model = script.Parent
wait(3)
for i = 1,1 do
TransformModel(Model:children(), Model:GetModelCFrame(), Model:GetModelCFrame() *CFrame.new(0,math.rad(-250),0), true)
wait(0.01)
end

If anyone can help me, that would be AWESOME.

3 comments

0

I believe you have to access the rotation property?

0

I meant a script... O_O

0

Yes, within the script. You access the rotation property and change it using Vector3.

2 answers

As I said, you need to use access the Rotation property by using Vector3.

while true do
	script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(0,0.1,0)
	wait(0.01)
end

2 comments

0

You guys are all noobs... First of all, letsallgo, that will only work for a Part, not a model. Second of all, Vector3 will rotate it, but it is not accessible with CFrame.

0

if your so good at it figure it out your self i'm a begginer

This discussion is preserved as it was. New answers, comments, and votes are closed.