One thing I'd like to ask you, is why to use an extra variable for shooting? You can just have one more state for your actor.
Also, I'd suggest using #define to make the managing of multiple different states easier.
#define allows you to define a word and tell what the compiler should treat that word as.
#define statements should be written in to Global.
Here's an example. Write this to Global Code and add the code with a name:
- Code: Select all
#define STAND_RIGHT 0
#define STAND_LEFT 1
Now, when ever you'd like to use your states for standing right or standing left, instead of the numbers 0 and 1, you can write STAND_RIGHT or STAND_LEFT.
Like this:
- Code: Select all
switch(state)
{
case STAND_RIGHT:
//Do something here
break;
case STAND_LEFT:
//Do something here, too
break;
}
How the compiler will see the above code:
- Code: Select all
switch(state)
{
case 0:
//Do something here
break;
case 1:
//Do something here, too
break;
}
So, define allows you to stay more organized with your states without causing any difference to how the compiler sees your code.
You can also use the defined words to set your state variable to a certain value:
- Code: Select all
state = STAND_RIGHT;
There's also a lot things #define can do, since you can use it to define anything to anything, you can even do this:
- Code: Select all
#define KILL DestroyActor("Event Actor") //No semicolon here!
And then, for example, in key down -> enter:
- Code: Select all
KILL;
That will destroy the event actor.

So, defines can be really useful, especially with what you're doing with the state method.