getVisibility (VBS2)

From Bohemia Interactive Community

Jump to: navigation, search
Editors, please check Policy: Scripting Command Page Syntax.
Introduced in Virtual Battlespace 2 version 1.00

Click on the images for descriptions

Introduced in

Game:
Virtual Battlespace 2
Version:
1.00

Description

Description:
Returns the visibility of one object to another.
If the target consists of an array of objects, the object with the highest visibility is used.
Considers only the origin (the center) of the object, so if only a part of the object is visible the command will still return 0.
If you want to consider the edges of the object as well as the center, then use the fn_vbs_getVisibility function.

Syntax

Syntax:
viewer getVisibility target
Parameters:
viewer: Object
target: Object, Array of objects or AGL Position
Return Value:
Number (from 0=not visible to 1=full visibility)

Examples

Example 1:
_canSee = player getVisibility house

Additional Information

Multiplayer:
Behaviour unknown.
See also:
isCollision, CollisionDetection

Notes

Notes

+ Add Note

Only post proven facts here. Use the talk page or the forums for discussions.

Notes

Return value is a number from 0-1 describing how well the viewer can see the target. The lower the number, the less the viewer can see.

In practice, even when visibility is perfect between the viewer and target, the return value will still be less than 1. Generally the return value peaks at something around 0.75-0.85, depending on the target.

Bottom Section

Personal tools
Buy ArmA now!