Colliding camera with mesh

Blitz3D Forums/Blitz3D Beginners Area/Colliding camera with mesh

Matty,

Great advice buddy. So I understand that what happens is that when the player is in the proximity of the gun, they will be able to pick it up when EntityDistance(camera,G\GMESH) <= dist. This works a treat.

A second little question - About collisions. I would like to detect collision with the gun only when in proximity of it so, I am using the function below but cannot see how to check the clearcollisions function has worked when outside of the gun proximity. Any Ideas on how to check the collision list has been cleared...Thanks,

Function neargun()

If guncol=0
ClearCollisions;Clear all collisions
End If

For g.gun = Each gun

If EntityDistance(camera,G\GMESH) <= dist Then
Collisions col_character,col_gun,2,2
Text 0,10, "Press enter to use the " +G\GNAME$
If KeyHit( 28 ) Then gogun=1-gogun
Else
guncol=0
End If

Next

End Function