Creating Material Instances in an actor class

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

envenger

New Member
Jan 16, 2014
2
0
0
Hi guys... How do I create a MaterialInstanceConstant in an actor class.

I tried reading some guides on net about it, most of them give an error.

Code:
class Testactor extends Actor
ClassGroup(Test)
placeable;


var MaterialInstanceConstant conc;

function PostBeginPlay()
{
conc = Mesh.CreateAndSetMaterialInstanceConstant(0);
super.PostBeginPlay();
}

defaultproperties
{
  Begin Object Class=StaticMeshComponent Name=MyStaticMeshComponent
    StaticMesh=StaticMesh'PhysTest_Resources.RemadePhysBarrel'
  End Object
  Components.Add(MyStaticMeshComponent)
}

Also gives and error.