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

Can I change the whole rotation of a model without going to all the parts?

Can I change the whole rotation of a model because I have to go to every part in the model and rotate it

4 comments

0

By using script

0

add a primary part to the model then use SetPrimaryPartCFrame()

0

How do I do that?

0

ill make an answer

2 answers

Using Primary parts and SetPrimaryPartCFrame you can rotate a whole model.

Remember to set the property "Primary Part" in the model to any part to rotate around.

local model = workspace.Model -- set

model:SetPrimaryPartCFrame(CFrame.new(model.PrimaryPart.Position)*CFrame.Angles(0,90,0)) -- change the angle...

You could always tween models.. Here is tunicus's snippet

local tweenService = game:GetService("TweenService")
local info = TweenInfo.new()

local function tweenModel(model, CF)
	local CFrameValue = Instance.new("CFrameValue")
	CFrameValue.Value = model:GetPrimaryPartCFrame()

	CFrameValue:GetPropertyChangedSignal("Value"):Connect(function()
		model:SetPrimaryPartCFrame(CFrameValue.Value)
	end)
	
	local tween = tweenService:Create(CFrameValue, info, {Value = CF})
	tween:Play()
	
	tween.Completed:Connect(function()
		CFrameValue:Destroy()
	end)
end

Anywho, if this helps, accept the answer

5 comments

0

oop- as soon as I make a small answer lol

0

winky face ;)

0

Nice answer :)

0

I found something on reddit saying to rotate the handle. I will ask a question on that

0

Thanks Jesse, alright king

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