# How to Access a MaterialParameterCollection from C++

**URL:** <https://forums.unrealengine.com/t/how-to-access-a-materialparametercollection-from-c/472858>\
**Category:** Asset Creation\
**Tags:** access, unreal-engine, question\
**Created:** [October 13, 2020, 2:17pm UTC](https://forums.unrealengine.com/t/how-to-access-a-materialparametercollection-from-c/472858 "2020-10-13T14:17:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_d4cf4603](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d4cf4603](https://forums.unrealengine.com/u/anonymous_user_d4cf4603)\
**Post date:** [October 13, 2020, 2:17pm UTC](https://forums.unrealengine.com/t/how-to-access-a-materialparametercollection-from-c/472858/1 "2020-10-13T14:17:50Z")

</div>

I have a C++ MaterialParameterCollection in my editor. I want to access this material parameter collection from my C++ code. What is the getter for accessing a specific material parameter collection, and how might I set a scalar and vector parameter within?

Thank you.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_d4cf4603](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d4cf4603](https://forums.unrealengine.com/u/anonymous_user_d4cf4603)\
**Post date:** [October 16, 2020, 3:01am UTC](https://forums.unrealengine.com/t/how-to-access-a-materialparametercollection-from-c/472858/2 "2020-10-16T03:01:50Z")

</div>

This is very challenging to get working the way you might want. The only way that worked for me was to use the KISMET interface library to access the MaterialParameterCollection and change a scalar value accordingly. This is done in the following way.

```
UKismetMaterialLibrary::SetScalarParameterValue(MyWorld, MyParameterCollection, FName(TEXT("MyScalar")), <MyScalarFloat>);

```

---

<div class="post-metadata">

**Author:** ![Frey-HE](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Frey-HE](https://forums.unrealengine.com/u/Frey-HE)\
**Post date:** [August 29, 2021, 12:00pm UTC](https://forums.unrealengine.com/t/how-to-access-a-materialparametercollection-from-c/472858/3 "2021-08-29T12:00:57Z")

</div>

UKismetMaterialLibrary::SetScalarParameterValue(this, YourMPCName, FName(TEXT(“YourParameterName”)), YourNewParameter);I use this method to achieve dynamic modification
