Problem with setting the Orientation of an object

Hi,
I have a problem with Orientation of an object when I try to tween it. The problem is that the orientation of the object I want to tween is not changing at all. I have the reference code bellow. Any suggestions?

local player = game:GetService("Players")
local debris = game:GetService("Debris")
local eggName = script.Parent.Name
local eggHatchGui = player.LocalPlayer:WaitForChild("PlayerGui"):WaitForChild("eggHatch")
local tween = game:GetService("TweenService")

script.Parent.MouseButton1Click:Connect(function()

	local tweenInfo = TweenInfo.new(.5, Enum.EasingStyle.Cubic, Enum.EasingDirection.In, 1, true)
	local viewportFrame = Instance.new("ViewportFrame")
	viewportFrame.Size = UDim2.fromScale(1, 1)
	viewportFrame.Parent = player.LocalPlayer:WaitForChild("PlayerGui"):WaitForChild("eggHatch"):WaitForChild("Viewport")
	viewportFrame.Visible = true
	viewportFrame.BackgroundTransparency = 1

	local clonePart = game.ReplicatedStorage:WaitForChild("Eggs")[eggName]:Clone()
	clonePart.Parent = viewportFrame
	clonePart.PrimaryPart.Orientation = Vector3.new(-30, 0, 0)

	local viewportCamera = Instance.new("Camera")
	viewportFrame.CurrentCamera = viewportCamera
	viewportCamera.Parent = viewportFrame
	viewportCamera.CFrame = CFrame.new(clonePart.PrimaryPart.Position + Vector3.new(0, 0, 3), clonePart.PrimaryPart.Position)

	eggHatchGui:WaitForChild("Viewport").Visible = true
	local tweenCreate = tween:Create(clonePart.PrimaryPart, tweenInfo, {Orientation = Vector3.new(30, 0 , 0)})
	tweenCreate:Play()
end)

I managed to solve it. I just rotate the root part of the model not the primary part.

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