How can I trace a line from a character using C++?

I used Rama’s trace functions here and placed it in a player controller. For some reason it either hits the floor or it doesn’t hit at all. Any help? I also want to know if there’s a better way to use line tracing.

I used tracesinglelinebyobject() and put the ECC_WorldStatic in it.