MousePick()

Syntax

Result = MousePick(#Camera, x, y [, PickMask])
Description
Simulates a mouse click and returns which object is under the specified 2D point (x,y - in pixels) on the specified #Camera. 'PickMask' specifies the entity mask used while performing the pick. Only the entities with a mask matching the PickMask value will be reported. If this parameter is omitted, all the entities are valid for the pick detection. The mask can be a combination, to select more than one entity group. To have more information about pick mask, see CreateEntity(). The returned value can be:
  -1 : Nothing has been detected
  #PB_World_WaterPick: the click occurred on the water.
  #PB_World_TerrainPick: the click occurred on a terrain.
  0 and above: the click occurred on the #Entity. The entity pick is based on its bounding box, not on its mesh.
To get more information about the picked object position, use PickX(), PickY() and PickZ().

Supported OS

All

<- LoadWorld() - Engine3D Index - MouseRayCast() ->