# StaticMesh Collision Presets / Collision Object type information is not readable from an Object of UStaticMesh?

**URL:** <https://forums.unrealengine.com/t/staticmesh-collision-presets-collision-object-type-information-is-not-readable-from-an-object-of-ustaticmesh/739807>\
**Category:** Asset Creation\
**Tags:** static-mesh-editor, unreal-engine, editor, staticmesh, question, CPP\
**Created:** [January 1, 2023, 11:14am UTC](https://forums.unrealengine.com/t/staticmesh-collision-presets-collision-object-type-information-is-not-readable-from-an-object-of-ustaticmesh/739807 "2023-01-01T11:14:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Subadventure](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Subadventure](https://forums.unrealengine.com/u/Subadventure)\
**Post date:** [January 1, 2023, 11:14am UTC](https://forums.unrealengine.com/t/staticmesh-collision-presets-collision-object-type-information-is-not-readable-from-an-object-of-ustaticmesh/739807/1 "2023-01-01T11:14:35Z")

</div>

Hi!  
I can’t access Collision Profile / Collision Preset information, wich I set up in the Static Mesh Editor UI, in C++… Where I can access this information? Even the BodySetup just shows me an Enum with BodyCollisionEnabled or Disabled / A TraceTag with Simple/Complex Collision is used…  
 ![Unbenannt1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/c/1/6c1c5b7427434764ab5fd1d1c5516f6265a90d82.png)

 ![Unbenannt12](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/b/3/1b3cf6be35ef1ca1aefd1b3c71af13f0109dc98e.png)  
 ![Unbenannt](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/1/e/31ef44582a794274438d5fc65cd47d8ba04e00b5.png)

Pls tell me where do they hide that information as i got no time to dig throught every c++ class -\_-  
Much love for all!

---

<div class="post-metadata">

**Author:** ![DevinSherry](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/devinsherry/32/1101099_2.png) [@DevinSherry](https://forums.unrealengine.com/u/DevinSherry)\
**Post date:** [January 1, 2023, 12:05pm UTC](https://forums.unrealengine.com/t/staticmesh-collision-presets-collision-object-type-information-is-not-readable-from-an-object-of-ustaticmesh/739807/2 "2023-01-01T12:05:05Z")

</div>

You can use the following functions:

Mesh-\>GetCollisionObjectType();  
Mesh-\>GetCollisionProfileName();

Here is an example and having this information added to the log:

```auto
// Called when the game starts or when spawned
void AMyActor::BeginPlay()
{
	Super::BeginPlay();
	const ECollisionChannel Type = StaticMesh->GetCollisionObjectType();
	UE_LOG(LogTemp, Warning, TEXT("Object Type: %s"), *UEnum::GetDisplayValueAsText(Type).ToString());
	
	const FName ProfileName = StaticMesh->GetCollisionProfileName();
	UE_LOG(LogTemp, Warning, TEXT("Profile Name: %s"), *ProfileName.ToString());
	
}

```

The result is this:

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/c/d/acd8efe5efd9b2391861cfa67cfa3485d8588a81.png)

I hope this helps, and good luck 🙂

---

<div class="post-metadata">

**Author:** ![Subadventure](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Subadventure](https://forums.unrealengine.com/u/Subadventure)\
**Post date:** [January 1, 2023, 6:55pm UTC](https://forums.unrealengine.com/t/staticmesh-collision-presets-collision-object-type-information-is-not-readable-from-an-object-of-ustaticmesh/739807/3 "2023-01-01T18:55:38Z")

</div>

Well, thanks for the answer but u got me wrong ;(  
In your case, you are accessing the UStaticMeshComponent and well yeah, there we got those informations, as I need to set it in exactly that kinda Component!  
(UFoliageInstancedStaticMeshComponent)  
I can Get and Set Collision Values in the specific UFoliageType\_InstancedStaticMesh, but I want to READ from my RAW UStaticMesh.uasset!  
Probably I need to create Foliage Assets where that Data get stored but this doesn’t answer my question… where does they store that collision profiles from my StaticMesh.uassets?  
LOL true ninja values

---

<div class="post-metadata">

**Author:** ![sPaker032](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@sPaker032](https://forums.unrealengine.com/u/sPaker032)\
**Post date:** [September 19, 2023, 4:10am UTC](https://forums.unrealengine.com/t/staticmesh-collision-presets-collision-object-type-information-is-not-readable-from-an-object-of-ustaticmesh/739807/4 "2023-09-19T04:10:42Z")

</div>

try this:  
// UStaticMesh Mesh;

```auto
Mesh.GetBodySetup()->DefaultInstance.GetCollisionProfileName()

```
