I’m trying to create my own actor that is placeable in the editor. And i’d like to allow it to be dynamically assigned a static mesh actor in the editor.
How would i do this? Here’s what i have:
class MyFluidSurfaceActor_River extends Actor
placeable;
var StaticMeshComponent RiverMesh;
defaultproperties
{
Begin Object class=StaticMeshComponent Name=StaticMeshComp
StaticMesh=StaticMesh'ColdItems.StaticMeshes.crate' //Placeholder
End Object
RiverMesh=StaticMeshComp
Components.Add(StaticMeshComp)
}
In this case i’d like to assign the static mesh in the StaticMeshComp within the editor (so i can reuse this actor with lots of different meshes).
class PBMainActor extends Actor
ClassGroup(PBSkeletalMeshes)
placeable;
Make the ClassGroup(ColdsStaticMeshes) or any name you like. then go into editor and you’ll see it there under your new name
class MyFluidSurfaceActor_River extends Actor
ClassGroup(ColdsStaticMeshes)
placeable;
var StaticMeshComponent RiverMesh;
var() StaticMesh ColdsModel;//this will allow you to hit f4 and add in what ever model you want,
once you've added MyFluidSurfaceActor_River to your map
function PostBeginPlay()
{
local bool AreWeMade;
AreWeMade = RiverMesh.SetStaticMesh(ColdsModel);
`log("MyFluidSurfaceActor_River::PostBeginPlay() Has Started up!, Is the test MyFluidSurfaceActor_River Running = " @ AreWeMade);
}
defaultproperties
{
Begin Object class=StaticMeshComponent Name=StaticMeshComp
StaticMesh=StaticMesh'ColdItems.StaticMeshes.crate' //Placeholder
End Object
RiverMesh=StaticMeshComp
Components.Add(StaticMeshComp)
}