Code: Select all
state PlayerWalking
{
ignores SeePlayer, HearNoise, Bump;
event tick(float deltaTime)
{
local name MyAnimGroup;
bAnimTransition = false;
if (Physics == PHYS_Walking)
{
if ((Velocity.X * Velocity.X + Velocity.Y * Velocity.Y) < 1000) { MyAnimGroup = 'Stand'; }
else if (bIsWalking) {
if ( (MyAnimGroup != 'Walk') ) { MyAnimGroup = 'Walk'; }
}
else {
if ( (MyAnimGroup != 'Run') ) { MyAnimGroup = 'Run'; }
}
}
else { PlayInAir(); }
SActor.AnimGroup = MyAnimGroup;
}EDIT 6/8/17
//========================
So since I'm using an additional actor I'm think I might just copy this code into my existing sprite actors and just check the attach actor owner's current physics/speed and leave the player's origional code alone. However I think I will get rid of their animation code and adapt it into the SpriteActor I have, actig as their external "animation". But is there a better way to just get a name from my playerpawn and send it to my sprite actor? This name will determine what sprites are pulled from a sprite library I pulled sprites into from an .int.
Also I need to clarify that I edited AnimEnd() in PlayerWalking and replaced it with this tick, which has most of the original code. Mind you, this method was still not working before I replaced the original code.
Also if I get this working, I'm gonna make a small new test level and upload it to youtube. I'd like a still actor to display just standing sprites and not a walking set or running nor jumping sets.