Hi. This is like three years from the original answer, but consider using the public function GetStaticMesh() instead of ->StaticMesh. I got an error. Thanks.
Or if you just want to get the ONE static mesh that it has, you can take the first by doing: UActorComponent* comp = GetComponentByClass(UStaticMeshComponent::StaticClass()); . You would have to use Casting to change UActorComponent to the specific StaticMesh Component you have.