How do I raycast in c++?

I also made a question at Raycasting doesn't return anything. - UE4 AnswerHub

I think it has something to do with the actor that I am trying to raycast. Maybe I need to enable raycasting on the actor somehow? The only thing that I did was that I have set the collision to blocking all for the static mesh.

I found the error, I just needed to use LineTraceSingle from UWorld.

But what is the purpose of LineTraceComponent from Mesh?

LineTraceComponent is for tracing against a single component, rather than the world.

vblanco have this tutorial, using raycast to hit actors in scene

i believe to be very useful for you