Making a bodyGyro not change the Y axis of a parts rotation

I have the following script

gy = Instance.new("BodyGyro")
gy.MaxTorque = Vector3.new(1,1,1)*10000000
gy.P = gy.P * 10

game["Run Service"].RenderStepped:Connect(function()
	
	if game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:FindFirstChild("HumanoidRootPart") then
		gy.Parent = game.Players.LocalPlayer.Character:FindFirstChild("HumanoidRootPart")
		local g = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame
		local gg = (CFrame.new(g.p, workspace.Earth.Position))
		gy.CFrame = gg * CFrame.Angles(90,0,0)
	end
end)

This yields the following result: https://gyazo.com/15d6b4e0c781a338633ad512d5aca9b3
Now while the character rotates so that they are grounded on the planet, they always face in the direction of the planet center. I want them to be able to face in a different way but still be grounded with rotation like this: https://gyazo.com/6f55608ed5218f0489ba63e55ae17d0a

So it seems that I need to not allow the BodyGyro to rotate the Y axis of rotation. If this is not what should be done, feel free to notify me and/or suggest otherwise