public static bool ExilePather.Raycast(Vector2i start, Vector2i end, out Vector2i hitPoint, bool dontLeaveFrame = false, bool shouldUseRangedMap = false)
Project a ray from start to end, if the ray encounter a non walkable location or an obstacle, it return false and out the location of the obstacle as hitpoint. This function do not consider dynamic objects (object collected with Objectmanager, like doors, chests, monsters etc).
boolNo current DPB page is linked for this built-in, external, generic or compatibility-only type.Parameters
start- Parameter type:
Vector2iThe start position of the ray.
end- Parameter type:
Vector2iThe end Position of the ray.
hitPoint- Parameter type:
Vector2iIf the function return false, hitpoint is set to the first non walkable position.
dontLeaveFrame- Parameter type:
boolNo current DPB page is linked for this built-in, external, generic or compatibility-only type.Not read by this overload in the reviewed source. Do not rely on this argument to change its behavior.
shouldUseRangedMap- Parameter type:
boolNo current DPB page is linked for this built-in, external, generic or compatibility-only type.Should the function evaluate the Ranged map instead of the Walk map? use this for spells or arrows.
Returns: Return true if the function do not encounter any obstacle, or false if a obstacle is encountered.
This function also Broadcast a message with id "Raycast_Result" and has 4 parms as input: Vector2i start, Vector2i end, bool Returnvalue, Vector2i hitPoint. If ground map is used, detour's raycast is used which is generally a lot faster.