Unreal Engine 4 Documentation > Unreal Engine API Reference > Runtime > Engine > Components > UPrimitiveComponent > UPrimitiveComponent::CreateAndSetMaterialInstanceDynamicFromMaterial

UPrimitiveComponent::CreateAndSetMaterialInstanceDynamicFromMaterial

Syntax

virtual UMaterialInstanceDynamic * CreateAndSetMaterialInstanceDynamicFromMaterial
(
    int32 ElementIndex,
    class UMaterialInterface * Parent
)

Remarks

Creates a Dynamic Material Instance for the specified element index. The parent of the instance is set to the material being replaced.

Parameters

Parameter

Description

ElementIndex

The index of the skin to replace the material for. If invalid, the material is unchanged and NULL is returned.

References

Module

Engine

Header

Runtime/Engine/Classes/Components/PrimitiveComponent.h

Source

Runtime/Engine/Private/Components/PrimitiveComponent.cpp