Returns more detailed information on the subgroup and face of a mesh that have been hit.
Properties
hit |
Returns true if there was a hit. |
object |
Returns an Object class for the object hit. |
subgroup |
Returns a Subgroup class for the subgroup hit. |
faceIndex |
Returns the zero based index for the face hit. |
faceU |
The proportion across the face (between 0 and 1) |
faceV |
The proportion across the face (between 0 and 1) |
posWorld |
The real world position hit (Vector). |
posLocal |
The position of the hit relative to the position of the object (Vector). |
distance |
The distance the hit occurred at (float). |
mySubgroup |
If this is a collision between two objects, this returns the Subgroup class for the subgroup of the current object, or null if no subgroup/not a mesh. |
myFaceIndex |
If this is a collision between two objects, this returns the zero based face index of the face hit in the subgroup of the current object. |
textureName |
The filename of the texture hit (null if no texture). |
textureU |
The U coordinate across the texture hit. |
textureV |
The V coordinate across the texture hit. |
Examples
function onClick()
{
print("You clicked face "+system.ui.mouse.hitInfo.faceIndex);
}
Remarks
The 'object' and 'subgroup' properties return classes so to get a sub-property (for example the subgroup id) first check for null, then look up the Id property.
See Also


