Issue with the PlayerAgent class

Mar 21, 2012 at 12:11 PM


I have tried to use the "Agent" system according to the "video tutorial 6".
- I use the LocalSessionManager
- My player is identified
- I have started the session
- I have created a "Player" class, child of "PlayerAgent" class
- I have created a "PlayerInputBehavior", child of "Behavior" class with a "ReadPlayerInput" method and i have added this behavior to the "Player" class
- I have called the method CreatePlayerAgent with : var player = SessionManager.CurrentSession.CreatePlayerAgent<Player>(SessionManager.CurrentSession.LocalPlayers[0]);
- I have added the Player class in my scene object components
But nothing happens. My method "ReadPlayerInput" in the "PlayerInputBehavior" class is never called.
Also, the "Process" methods in "PlayerAgent" class and "Behavior" class are never called.

I have forgot something ?

Thank you

Mar 21, 2012 at 1:22 PM

Did you start the session? :)

Mar 21, 2012 at 1:28 PM

Yes. The session is started.

If the session is not started i have an exception when a call the method "CreatePlayerAgent".

How the Process methods are called ?

Mar 21, 2012 at 3:06 PM

The Process methods are called by the Session in its IUpdate.Update() method.

Could you paste the code how you setup the PlayerAgent and where you do it?