There are many ways to do it but I will give you an effective tip:
first you will create a variable with the name you want and with values like this:
- Active = 0
then you will create a "camera controller", just drag it, you will give it a name "player".
Then you drag a plane and put it under the object with which the player will interact, you can call it "target" it must touch the ground, remember to set its collision to "1" and leave the static box blank, the size of the "target" You can put it in any size, if it is very small the player or camera should get close enough to the object to collide with the plane.
Now you must drag the "loop" command into the plane within this command "if collision" and you will choose the name of the camera "player", then within it you will put the command "set", in it you choose the variable " Active "and you set it with the value" 1 ", (so when the player collides with the plane the variable" Active "will be set to" 1 ")
Now we must set the same variable to "0" when the player does not collide:
You just drag within the "if collision" command the "else" command and copy the "set" command and drag it to "else", you will only set the value of "Active" to "0".
Finally you select the object that you want to be eliminated when the player clicks, inside it you will put the command "loop" then inside the command "if", in it you choose the variable "Active" and next to "equal to" you put " 1 "(so the object will detect when the player is within the limit of the" target ") now inside" if "you drag the command" remove "(this way the object will be eliminated).
I hope it has served you.