# How to get Roughness of a component?

**URL:** <https://forums.unrealengine.com/t/how-to-get-roughness-of-a-component/454631>\
**Category:** Rendering\
**Tags:** roughness, Ray-Tracing, unreal-engine, question\
**Created:** [August 30, 2019, 12:32pm UTC](https://forums.unrealengine.com/t/how-to-get-roughness-of-a-component/454631 "2019-08-30T12:32:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_906b6ce0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_906b6ce0](https://forums.unrealengine.com/u/anonymous_user_906b6ce0)\
**Post date:** [August 30, 2019, 12:32pm UTC](https://forums.unrealengine.com/t/how-to-get-roughness-of-a-component/454631/1 "2019-08-30T12:32:59Z")

</div>

Hello,  
I am using ray-trace to scan 360 degrees.

```
GetWorld()->LineTraceSingleByChannel(OutHit, Start, End, ECC_Visibility, CollisionParams))
GEngine->AddOnScreenDebugMessage(-1, 1.f, FColor::Red, FString::Printf(*OutHit.GetComponent()->GetName()));

```

Is it possible to get the roughness of the material as float?  
I am trying :

```
OutHit.GetComponent()->GetMaterial(0)->GetBaseMaterial()->Roughness

```

I am not sure if this gives what I need. If it gives roughness as I am looking for, how can I get it in float?
