Is there any way to access unreal.HitResult properties in python?

Hello! I have created a line trace in a python script, and it appears to work, except that I can’t access any information about the HitResult. If the HitResult if saved in a variable called myhit, attempting to read myhit.get_editor_property("location") throws this error: Error: Exception: HitResult: Property 'Location' for attribute 'location' on 'HitResult' is protected and cannot be read

Does anyone know of another way of going about accessing a HitResult, or is this simply not supported by the Python API at the moment?

1 Like

Hi AchAch. I had the same problem. I found python HitResult(StructBase) have a function “to_tuple()”. so I converted HitResult to tuple, accessing it with index number. It works. Hope you can solve your problem. :slight_smile:

1 Like