Editor crashes when try ray cast Physics Bodys.

Hi, Im trying to ray cast some objects with Physics Body collision channel and get his name, but, when I set the object, chair by example, and toggle his Physics simulation, when i push Play, UE Editor crashes.

What can I do?

Just to make sure the Actor is valid, replace “*Hit.GetActor()->GetName()” with “*GetNameSafe(Hit.GetActor())”

Yup - the problem with your code is when the trace doesn’t hit anything, it won’t have an actor and you’ll be trying to dereference a null pointer. A common crash.