Fully welded model only rotates primary part

I am trying to make a gui that shows the selected sword which is supposed to rotate, however it won’t, there is no errors regard the script, I have tried several different methods but not a single one works, here are some screenshot and the current script, I have made the handle visible to show the rotation:

local TweenService = game:GetService("TweenService")

local viewportFrame = script.Parent

local part = nil

script.Parent.Parent.Selected.Changed:Connect(function()
	if part ~= nil then
		part:Destroy()
	end
	part = script.Parent.Parent.Selected.Value:Clone()
	part:SetPrimaryPartCFrame(CFrame.new(Vector3.new(0,16,16),Vector3.new(-180, -90, 135)))
	--part.Position = Vector3.new(0, 18, 18)
	--part.Orientation = Vector3.new(-24, 127, 38)
	part.Parent = viewportFrame


	local viewportCamera = Instance.new("Camera")
	viewportFrame.CurrentCamera = viewportCamera

	local tweenInfo = TweenInfo.new(5, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut)

	local tween = TweenService:Create(part.PrimaryPart, tweenInfo, {Orientation = Vector3.new(0,360,0)})

	while true do
		tween:Play()
		tween.Completed:Wait()
	end
end)


image

1 Like

Maybe try attaching an AlignOrientation constraint to the primary part, then tween that.

1 Like

If you mean by setting one of the attachments to the handle, then another to a part, it did not in fact work.

I used a different method, it could be worse in the long run but it works for now so I could care less.

I believe the problem is you are tweening the orientation instead of the CFrame. I’ve noticed that tweening Position or Orientation can be very buggy so I always tween using the CFrame.

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