public static bool ExilePather.Raycast(Vector2i start, Vector2i end, List<NetworkObject> objectsToConsider, out Vector2i hitPoint, out int objectId, 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, and Object Id in case the obstacle is an NetworkObject. This function account for a given list of NetworkObjects to include in the calculation. This function account for the interactsize of the networkobject, so the hitboz is considered.
startVector2i- The start position of the ray.
endVector2i- The end Position of the ray.
objectsToConsiderList<NetworkObject>- A List of NetworkObject to include in the calculation
hitPointVector2i- If the function return false, hitpoint is set to the first non walkable position.
objectIdint- The Id of the eventual NetworkObject hit by the ray.
dontLeaveFramebool- Not read by this overload in the reviewed source. Do not rely on this argument to change its behavior.
shouldUseRangedMapbool- 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.