Announcement

Collapse
No announcement yet.

Overriding a state function in a derived class

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Overriding a state function in a derived class

    It is possible to overring a function in a parent class's state?

    For example I'm trying to override the BeginState() in state PlayerWalking (in PlayerController) so I can play my own running animation.

    Or is there a 'smarter' way of going about this?

    Thanks!

    #2
    It's exactly the same as overriding any other function:
    Code:
    state PlayerWalking
    {
    	function BeginState()
    	{
    		//Do stuff here.
    	}
    }

    Comment


      #3
      Ah. Ok. I thought that code overrode the entire state. But it just override what is defined in it.

      Thanks.

      Comment


        #4
        This is somewhat of a stupid question but how do I tell that the player character is physically running?

        I'm having trouble seeing anything in Pawn or PlayerController that tells me. (I'm using overriden MyPawn.PlayMoving() and MyPawn.PlayWaiting() to play the actual (looping) animations.)

        Thanks for any suggestions.

        Comment

        Working...
        X