Page MenuHomeFeedback Tracker

Add objectInFOV command
New, WishlistPublic


I think this would be very useful in many missions, having a objectInFOV command which returns boolean if object is in the field of view of the player or not.


Legacy ID
Additional Information

This command would of course only work local.

Example use:
objectInFOV _obj;


Event Timeline

gdscei edited Steps To Reproduce. (Show Details)Feb 22 2014, 9:15 PM
gdscei edited Additional Information. (Show Details)
gdscei set Category to Scripting.
gdscei set Reproducibility to N/A.
gdscei set Severity to None.
gdscei set Resolution to Open.
gdscei set Legacy ID to 2819016125.May 7 2016, 6:01 PM

You can already translate world coordinates to screen coordinates, object not in fov wont be on your screen.

gdscei added a subscriber: gdscei.May 7 2016, 6:01 PM

I know it's possible, but it's not convenient at all to do it like that. A simple command likeobjectInFOV would be less code, and probably faster too.

Im for new commands but i also know bis are extremely busy for that

Adding to this, I did some more testing with worldToScreen, and it seems quite inaccurate. It still gives back a position even though the object is not visible anymore on screen.
It seems like you need the screen to be at least [x] degrees away from the object before it gives back an empty position.

I'll create a new issue for this though.

  • EDIT

Seems to be because of safezones. So this new command would still be useful to actually check if an object is in view or not.

If such command is created it should return value from 0 to 1 instead of boolean. 1 is when the object is in the centre of screen and 0 is when it is beyond FOV (i.e. the edge of bounding box is not on the screen)