Announcement

Collapse
No announcement yet.

Playerstate variable always comes back as 0

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

    Playerstate variable always comes back as 0

    I have some variables in a playerstate such as Team, current weapon, team name, etc. The problem I seem to be having is that no matter what I do the Team variable always returns 0 (which is the default) when I get it from my player controller even though I have selected a team so it should be 0,1,2,3 etc depending on the team I am on.

    The setteam function is called on the server and the server knows I have the right team, so I feel as if I am only getting the original Playerstate team variable and not the updated one the server has one I select a team.

    Is there something specific I need to do in order to get the server side playerstate team value? Am I just on the completely wrong track here?






    #2
    Make sure your SetTeamVariable is actually called with a break point or make your variable ReNotify and print something when it changes.

    Comment


      #3
      I seem to remember Player State is instanced after the Player Controller, so if you set the Player State variables from the Player Controller Constructor, Player State won't exist yet. Also if you're loading a new level or start/join a new network session, the Player Controller and Player State instances are destroyed and new instance created, so any state data saved there in the previous level will be lost..

      Comment

      Working...
      X