I am writing a sprint state into a custom pawn class in my UDK game. I was looking at Epic's example code for managing states and a good chunk of game logic is in the Controller class rather than the Pawn class. This seems backwards to me. I originally thought that Controllers simply handled AI and player input and now I'm not sure where to place my own state code.
For example, the PlayerController.uc file has PlayerWalking, PlayerClimbing, etc. but seems to change the Pawn's states as well:
// player is climbing ladder
state PlayerClimbing
{
ignores SeePlayer, HearNoise, Bump;
event NotifyPhysicsVolumeChange( PhysicsVolume NewVolume )
{
if( NewVolume.bWaterVolume )
{
GotoState( Pawn.WaterMovementState );
}
else
{
GotoState( Pawn.LandMovementState );
}
}
...
Since a sprinting state should negate the PlayerWalking state, should I be placing the sprinting state code in the Controller class instead of Pawn? How should that logic be handled? Thanks!