Announcement

Collapse
No announcement yet.

Change a viariable value in game

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

    Change a viariable value in game

    Hi,

    I made a Player Controller with a variable called : PlayerPawnStyle (structure)
    And I made a Player Pawn with a variable called : PlayerPawnStyle (structure)

    When I directly change in the editor, the value on the Player Controller variable and cast it on blueprint to the Player Pawn variable all is working !

    But when I try to change the value with a widget, the variable keep the default value... -_-

    So, Is it possible or is a way to change the value of a variable (structure) with a widget and in game ?

    Thanks a lot !

    Zoruk.

    #2
    Can you show the widget blueprint? I think its possible to accomplish what you are doing. Should be something like get player controller-->get pawn-->get/set variable name. I have my widgets cast to my game mode and my game state A LOT, but I can't think of any instance where my widget casts directly to an actor/pawn...

    Comment


      #3
      Can you give us a little bit of information about what you are trying to achieve? I don't understand why you need the structure on both controller and pawn.

      Comment


        #4
        I made a game where you create your character :
        https://www.youtube.com/watch?v=oBYX...eAL4Bo&index=1

        So, I need to tell to my player controller the "options" (in structure) the player choose and keep this data.

        Then, when you are in game, I need to take this "options" from the player controller to the player pawn. I nee this cause the player controller can spawn a mech and controle it (so it's another pawn...) :
        https://www.youtube.com/watch?v=7Q3T...eAL4Bo&index=2

        I hope it can help you...

        While this time I found a tutorial serie that can help me and make the real great Multiplayer options for my game :
        https://www.youtube.com/watch?v=SfD5...GjrWxHkWbHcjAl

        Hope to share this game with you soon

        Comment


          #5
          Oh I see. So you can have multiple pawns. What if you try as soon as you spawn the pawn, on begin play, copy the data from the controller to the local pawn? I hope that makes sense :P

          Comment


            #6
            Yes, I already try this, read the information from player controller and give it directly to pawn... I was thinking all will be all right but... Not really -_-

            I think, networking is important at the stage... So I think I continue my tutorial serie and tell you if it help me to fix this problem :S

            Comment


              #7
              Ok guys, I was totally out of how a multiplayer game give informations between blueprints xD

              You have to set PlayerState et GameInstance but you have to make lot of events running on client AND running on server !

              So, I understand that you can't work on blueprint communication as great as it should be without setting the Multiplayer Networking before.

              I will upload the youtube video soon to explain that !

              Comment

              Working...
              X