Help with tweening a parts rotation

Hey developers!

I’m currently trying to have a part tween similar to a frying pan seen in Ruthless Ragdolls.

Pan: video

I’ve tried replicating this with a pivot part, but when welding the pan to the pivot part, it doesn’t seem to move the pan with the part. The weld stays put, yet just fails to to its job. Might be with not being able to tween welded objects, but who knows.

Here’s what happened: https://gyazo.com/3fa798b5a476bf19687ac98340822eee

I can fix the rotation just fine, I just need to figure out how to get the pan moving with the pivot part.

2 Likes

Couldn’t you just add Welds to the Pan?

That’s a Common way to Tween Models.

I’ve already tried that and it didn’t work.

In my video, there is a pre-existing weld from the pan and the pivot.

You just have to put your Part and Pan into a model, then weld the Pan to the part.

Once it is done, you have to use the Part “CFrame” to tween his position or rotation, tweening it using part.position or part.rotation is automaticaly destroying the weld…

I made an example for you

Rotating Pan.rbxl (55,5 Ko)

local TweenService = game:GetService("TweenService")
local TweenInfos = TweenInfo.new(0.5)
local Part = script.Parent.Part
local Bool = true
local Goal = {}

while wait(1)do
	if Bool == true then
		Bool = false
		Goal.CFrame = Part.CFrame * CFrame.Angles(math.rad(45), 0, 0)
		local Tween = TweenService:Create(Part, TweenInfos, Goal)
		Tween:Play()
	elseif Bool == false then
		Bool = true
		Goal.CFrame = Part.CFrame * CFrame.Angles(math.rad(-45), 0, 0)
		local Tween = TweenService:Create(Part, TweenInfos, Goal)
		Tween:Play()
	end
end
1 Like

Alright, thanks for the help! I’ll try this out with the version I’m using.

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