Time for action – Experiments with Actors as variables
For this experiment we're going to bring back our old friend the AwesomeActor
. We'll use him as a variable in our AwesomePlayerController
.
For this experiment we'll need
AwesomeActor
to be visible, so let's make sure our default properties are set up for that. OurAwesomeActor
class should look like this:class AwesomeActor extends Actor; defaultproperties { Begin Object Class=SpriteComponent Name=Sprite Sprite=Texture2D'EditorResources.S_NavP' End Object Components.Add(Sprite) }
Since we'll be spawning
AwesomeActor
during gameplay we don't need it to be placeable, and we're not going to do anything more with it once it's spawned so we don't need thePostBeginPlay
function for now.In our
AwesomePlayerController
, we're going to use the function that's called when we click the left mouse button to fire, calledStartFire
. Let's add that to our class:exec function StartFire( optional byte FireModeNum ) { super.StartFire...