Vector Bellow/Above water.

What is the best way to check if a vector is under water?

These seem to work:
Creating an entity, checking its WaterLevel(), then deleting the entity.
Creating a trace from the vector to 1 unit above and see if it hits water.

But is there a better way?

Pretty sure that **[Util.PointContents](** will do the job.
local contents = util.PointContents( yourvector )
if( contents == CONTENTS_WATER ) then
//code here
[sp]I can’t remember the c++ operator to check if a variable has a certain bit,was that & or |?,so you could just do if contents & CONTENTS_WATER then or something like that[/sp]

I’ll figure it out, thanks.

It’s &, by the way.