find_nearest_ray_intersection_with_mesh
Cast a ray against a DynamicMeshActor's live mesh to return the nearest hit point, distance, and triangle from the latest mesh edits.
Instructions
Cast a ray against the live dynamic mesh of a DynamicMeshActor and return the nearest hit via UGeometryScriptLibrary_MeshSpatial::FindNearestRayIntersectionWithMesh. Every call builds a fresh BVH from the mesh as it is now (the plugin keeps none), so the answer always reflects the latest mesh edits. The engine normalizes ray_direction, so ray_parameter is the distance from ray_origin to the hit. hit is false when nothing is hit within max_distance. The mesh is not changed.
Returns: { actor_name, hit: bool, ray_parameter, hit_triangle_id, hit_position_x/y/z, hit_bary_coords_x/y/z } -- actor_name is the dynamic mesh component's name, not the actor label; ray_parameter is a distance along the normalized direction.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| actor_name | Yes | Label or name of the target DynamicMeshActor. | |
| ray_origin | No | [x, y, z] origin point of the ray in mesh-local space. | |
| max_distance | No | Optional float; max search distance (0 = unlimited). | |
| ray_direction | No | [x, y, z] direction of the ray; the engine normalizes it, so its length does not matter. | |
| allow_unsafe_modified | No | Optional; maps to bAllowUnsafeModifiedQueries (default false). It has no effect: the BVH is built fresh on every call, so it always matches the mesh. |