You could use
Obviously you should store the GraphicsWidth and GraphicsHeight in some global variables so the functions do not have to called everytime. Especially if this function is called often.
yinch'03
Function SafeEntityInView(Cam, Ent) EntX# = EntityX(Ent, True) EntY# = EntityY(Ent, True) EntZ# = EntityZ(Ent, True) CameraProject(Cam, EntX, EntY, EntZ) ScreenX = ProjectedX() ScreenY = ProjectedY() if (ScreenX >= 0) and (ScreenY >= 0) and (ScreenX < GraphicsWidth()) and (ScreenY < GraphicsHeight()) then return True else return False end if end function
Obviously you should store the GraphicsWidth and GraphicsHeight in some global variables so the functions do not have to called everytime. Especially if this function is called often.
yinch'03