CFrame.Angles, make Position stay in place


local value = CFrame.Angles(0, 0, math.rad(size * (num == 1 and 1 or -1)))

So the problem is here, X and Y positions. I am tweening this value for 3 eggs at the same time. When I tween, they all go to same X and Y position. Is there a way to make the eggs in same position they were already and not 0,0? I tried calculating but then it bothers the angle of rotation of the egg.

local value = egg.CFrame * CFrame.Angles(0, 0, math.rad(size * (num == 1 and 1 or -1)))

Tried doing that but now the egg is going out of screen.

May I see the code where you set the position of the egg?


    local ChangeTweenPos = Instance.new("CFrameValue")
    
    local PetPos = Instance.new("CFrameValue")
    local newOffset = cameraOffset + Vector3.new(-0.25, 0, 0)
    local Workspace = game.Workspace
    local EggsFolder = Workspace:WaitForChild("Eggs")
    local EggDisplay = EggsFolder:WaitForChild(Egg).EggModel.Egg

    
   
    
    local EggClone = EggDisplay:Clone()
    MakeTemporary(EggClone)
    EggClone.Parent = workspace
    if EggNumber == 2 then
        ChangeTweenPos.Value = CFrame.new(5,0,0)
    end
    
        local speedDiv = 1
	    repeat
		    wait(len)
		    num = num + 1
		    if num == 3 then
			    num = 1
		    end
		    local value =  CFrame.Angles(0, 0, math.rad(size * (num == 1 and 1 or -1)))
		    TweenService:Create(ChangeTweenPos, TweenInfo.new(len, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {Value = value}):Play()
		    len = len / 1.15 / (speedDiv > 1 and speedDiv / 1.5 or speedDiv)
		    size = size / 1.025
        until len <= 0.015
        eggDisplay:Disconnect()

Did you try

local value =  ChangeTweenPos.Value * CFrame.Angles(0, 0, math.rad(size * (num == 1 and 1 or -1)))
3 Likes