Announcement

Collapse
No announcement yet.

cast to custom player state always fails??

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

    cast to custom player state always fails??

    hi can anyone help i don't understand why this cast is failing.

    Click image for larger version

Name:	eb060aae0f3a4e3180d999f11ef55425.png
Views:	1
Size:	124.5 KB
ID:	1212155

    i have checked and the player controller is valid. i have set the custom game mode in my level and all the settings are correct but no matter what i do this cast always fails.

    thanks

    #2
    Check world settings for game mode override, and make sure you are actually using the correct player state. Try resetting the options to your custom player state.

    Comment


      #3
      What bp is this called in and when?

      It's possible depending on when and where it's called before it spawns the playerstate if above mentioned is set right
      Inphidel / Brian - Developer of Ultraball
      http://www.ultraballgame.com

      Don't shy away from bugs in your game. Don't play it as intended. Break your game so you can fix it!

      Comment


        #4
        Originally posted by Inph1del View Post
        What bp is this called in and when?

        It's possible depending on when and where it's called before it spawns the playerstate if above mentioned is set right

        It's called from inside my login widget blueprint. After player presses the login button. I'm copying the code across from my other project and it works fine there I just don't get what I have missed . The project was based from a c++ project but the player state I made comes from the blueprint menu would this make a difference ?
        Last edited by EniGmaa; 02-28-2017, 07:49 AM.

        Comment


          #5
          Might be wrong but don't you have to get PlayerState from GameState?

          https://www.reddit.com/r/unrealengin...layer_clients/
          https://answers.unrealengine.com/que...blueprint.html

          Comment


            #6
            Thanks but those are mixed messages half people saying it should work and half saying you have to use the array but this doesn't make sense because then you need to distinguish between which player controller and which player state between each one and also I used get controller in my other project and the cast doesn't fail so this is why I'm confused

            Also the playerstate would return invalid
            Last edited by EniGmaa; 02-28-2017, 10:48 AM.

            Comment


              #7
              ok its definatly a bug just did the exact same setup in my other project and it works fine

              inside widget

              Click image for larger version

Name:	a7e395c55b844ddc9b0c2c893a78a941.png
Views:	1
Size:	122.7 KB
ID:	1124106

              inside custom playerstate

              Click image for larger version

Name:	27f3219f281d4eb588cc75301cebb2b5.png
Views:	1
Size:	40.7 KB
ID:	1124107

              and when i run the game and press the button it calls the custom function and prints the message

              Click image for larger version

Name:	282d1607164c4e8eadd0e42f02535ae2.png
Views:	1
Size:	177.6 KB
ID:	1124108


              i guess umg in 4.14 is bugged will have to upgrade to 4.15

              thanks anyway guys

              Comment


                #8
                Not still sure about this, but I think Epic has messed around with PlayerState a little bit. It´s getting harder for me to use them now too, but I´ve been useing them in older revs and everything was okay.
                [MARKETPLACE] The forest like gameplay system | building/crafting game
                Dark Souls 2 fighting system style
                Drivable Space Ship
                Run Knight Run | 48h game made
                Unreal Travel | 48h game made

                Comment

                Working...
                X