you can put values inside the random, random example (15,350) and the object will appear within these values, if these values appear in the sea, you can destroy the object and make it appear again until it does not appear in the sea
in this video, in my game I had to do something similar