Ey, just wanted to poke around in here. Had a question about raycasting and hitscans, couldn't find anything related to my question here or anywhere else online. Basically I wanted to know the best way to create decals/particles when a hitscan weapon for example, shoots through something like water, and hits the surface below it (like an ocean floor) but creates splash particles at the surface of the water.
I've tried using two separate raycasts in the same script that determine which surfaces are hit, the above water example using layer masks, but it's tricky. The raycast which hits the water instantiates a particle when I am looking at the water and firing the weapon, at even when looking at above-water terrain. Sorry for the long post, just hope there's a better solution out there of if I'm missing something, help could be provided
(I think this would also help with firing a weapon through glass for example)