Native: GetShapeTestResult - JayMontana36/LuaPlugin-GTAV GitHub Wiki
Parameters:
- ShapeTestHandle --integer
0
-- integer/0/nullptrVector3
-- userdata/vector3 (as received from a native)Vector3
-- userdata/vector3 (as received from a native)0
-- integer/0/nullptr
Returns:
- Status -- integer (0-2)
- Collision -- integer (0-1; 0==
false
, 1==true
) - EntityHandle -- integer
Usage Example:
local Vector3_EndCoords, Vector3_EntityOffsetCoords = GetEntityCoords(0,false), GetEntityCoords(0,false) -- Obtain our Vector3s for use with this native (which we'll need/have to do somehow; this is one of the ways)
local ShapeTestHandle -- = StartShapeTest_(...)
local Status, Collision, EntityHandle = GetShapeTestResult(ShapeTestHandle, 0, Vector3_EndCoords, Vector3_EntityOffsetCoords, 0)
while Status == 1 do
JM36.yield()
Status, Collision, EntityHandle = GetShapeTestResult(ShapeTestHandle, 0, Vector3_EndCoords, Vector3_EntityOffsetCoords, 0)
end
if Status == 2 then
-- Do whatever with these variables/returns
if Collision == 1 then -- if true then shapetest found/hit something
end
end