glue gun glue isnt a good idea because it could be harmful to the fish and if wet it will probably loosenand fall apart. Aquarium silicon would be the best thing to use.
i duno i think a glue gun could work. i make caves all the time, i used a glue gun once. it does fall off but the fish were fine. when u cleen ur tank u could always reglue it. i think aquarium sicone will work beter but its like 10$usd for 8 oz.
I have used hot glue before and it does work. It is completely safe (chemically) once it dries. You have to add a lot because once it gets wet, it softens and doesnt hold as well. Lastly, make sure when it dries there are no strings of it hanging off cuz the fish try to eat it. But like others have said, silicon works the best.