How could i make context action buttons disappear if the player is not near a part?

So i have been working on a interaction system and i have wanted to port it too mobile but im not really sure how i could remove the small button if the player is not near the part

	local I_R = function(NM ,AT)
				if NM == "I_R" then
					if AT == Enum.UserInputState.Begin then
						local I_RP = G_I()
						if I_RP then
							print(I_RP)
						end
					end
				end
			end
			CAS:BindAction("I_R", I_R, true, Enum.KeyCode.E, Enum.KeyCode.ButtonY)

You could do some stuff with math to detect the distance, and when it is greater than the distance you want, just put:

I_R.BackgroundTransparency = 1

context action buttons not the that

It should work, contextActionButtons are just like any other gui, so you can change the properties of them, though you might have to go through the playerGui