Using tweens to rotate changes part's position to 0,0,0

When tweening this with angles, the eye rotates but for some reason it sets its position to 0, 0, 0. Does anyone know why?

Start Position:
image

End Position:
image

Script:

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

while true do
	local x = math.random(0, 80)
	local y = math.random(0, 80)
	local z = math.random(0, 80)
	local goal = {}
	goal.CFrame = CFrame.Angles(math.rad(x),math.rad(y),math.rad(z))
	TweenService:Create(script.Parent.PrimaryPart, info, goal):Play()
	wait(math.random(1, 4.5))
end

try:

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

while true do
	local x = math.random(0, 80)
	local y = math.random(0, 80)
	local z = math.random(0, 80)
	local goal = {}
	goal.CFrame = CFrame.new(script.Parent.PrimaryPart.Position) * CFrame.Angles(math.rad(x),math.rad(y),math.rad(z))
	TweenService:Create(script.Parent.PrimaryPart, info, goal):Play()
	wait(math.random(1, 4.5))
end

you’re giving the CFrame no position so it’ll default to 0,0,0

1 Like

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