Changing Model's Orientation

I was wondering how could I change the orientation of a model. I’ve looked on some of them and they just make no since to me and either never get solved. I was looking if theres anything I could do to change it. I know you could do something with the PrimaryPart.

(I’m also trying to tween this)

you can manipulate the pivot of the model to change it’s orientation

local Model = workspace.Treehouse

local ModelWorldPivot = Model:GetPivot()
local NewPivot = ModelWorldPivot * CFrame.fromOrientation(0, 90, 0)

Model:PivotTo(NewPivot)

Yes, the problem is I want to tween it.

It’s unfortunately impossible to tween models. :frowning:

I dont think so, I have looked far and wide and I know you can do it with CFrame

If you’ve looked far and wide, shouldn’t you know how to do this then? Regardless, I’ll try to find a way to help you. Just let me run a few tests.

Yes you’re right, their just not what I needed. I’m trying to do like an obby with a wrecking ball moving back and fourth, there could also be a way we can try to weld it, but I already tried that also didnt work. Thank you for looking though, reply if you could find a way.

Thanks for the people trying to help, but I have figured it out, I did learn you cannot tween this, so here is what worked for me. Best of Luck!

local maxSwingAngle = math.rad(15)
local currentAngle = 0 
local swingSpeed = math.rad(1) 

while true do

	currentAngle = currentAngle + swingSpeed


	if currentAngle >= maxSwingAngle or currentAngle <= -maxSwingAngle then
		swingSpeed = -swingSpeed
	end


	local rotation = CFrame.fromOrientation(0, 0, currentAngle)


	script.Parent:SetPrimaryPartCFrame(script.Parent.PrimaryPart.CFrame * rotation)


	wait()
end

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.