Time for action – Components as variables
As our new AwesomeInfo
class doesn't have any subclasses, we can mess around with it without worrying about breaking anything, so let's keep working there.
First, we're going to put a
StaticMeshComponent
in the class, similar to what we did with ourAwesomeEnemy
class. Let's rewrite ourAwesomeInfo
class to look like the following code snippet:class AwesomeInfo extends Info placeable; defaultproperties { Begin Object Class=StaticMeshComponent Name=MyMesh StaticMesh=StaticMesh'UN_SimpleMeshes.TexPropCube_Dup' Materials(0)=Material'EditorMaterials.WidgetMaterial_Y' Scale3D=(X=0.25,Y=0.25,Z=0.25) End Object Components.Add(MyMesh) bHidden=false }
As we're using an emissive material, we don't need to set a light environment for the
StaticMeshComponent
. TheInfo
class hasbHidden
set toTrue
, we need to change it so we can see theAwesomeInfo
in game.Compile the code, and open
AwesomeTestMap
in the editor.If the
AwesomeActor
is...