• Make a util.TraceLine hit entities and water
    9 replies, posted
Trying to make a line trace that can hit entities and water using masks, but it seems impossible. Ideas?
Nvm found it
so post your solution? people google this stuff all the time
If anyone can find a way to hit entities and water, but not world, then I'll give the coins.
You can set the filter for traces to ignore the world
It won't hit water if you do that.
Here is a list of masks you can use for trace functions. MASK Enumerations There is a mask called "MASK_WATER".
MASK_WATER will hit water, but not entities. I want to hit entities and water but not world.
Do two traces, one for water, one for entities only, compare their hit fraction to select the closer one.
I don't like that solution but I think it's the only one since entities and world share the same CONTENTS mask and ignoreworld will make it unable to hit water.
Sorry, you need to Log In to post a reply to this thread.