Announcement

Collapse
No announcement yet.

Blueprint to Widget

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

    Blueprint to Widget

    Hi, I try an Integer variable from level Blueprint to my score Widget but I don't get it.

    Can someone help me please?

    #2
    It's probably better to setup your integer variable on your game mode, makes the code reusable and easier workflow. Create integer variable on your game mode, make the variable public. In your level blueprint begin play do a cast to game mode and get the integer variable and set it as a reference(promote to new variable). That way your level can update it freely.

    On the widget, click on the text variable and on the details of the right. Hit set new function. Have it cast to your game mode and get the integer variable, it will have all the updated data from your level.

    Comment


      #3
      Originally posted by NoSpaceGameDev View Post
      It's probably better to setup your integer variable on your game mode, makes the code reusable and easier workflow. Create integer variable on your game mode, make the variable public. In your level blueprint begin play do a cast to game mode and get the integer variable and set it as a reference(promote to new variable). That way your level can update it freely.

      On the widget, click on the text variable and on the details of the right. Hit set new function. Have it cast to your game mode and get the integer variable, it will have all the updated data from your level.
      I'am sorry but I didn't make it.

      I can't find what is the problem?

      Click image for larger version

Name:	Level-Blueprint.jpg
Views:	10
Size:	64.8 KB
ID:	1661570Click image for larger version

Name:	widget.jpg
Views:	11
Size:	69.6 KB
ID:	1661571

      Comment


        #4
        bsaridede It looks correct, but you are only setting the score at begin play, is this intentional?
        Set you variable manually to a number in your gamemode and disable the set in the level blueprint. See if the widget updates correctly.

        Comment


          #5
          Originally posted by Max Mittelstädt View Post
          bsaridede It looks correct, but you are only setting the score at begin play, is this intentional?
          Set you variable manually to a number in your gamemode and disable the set in the level blueprint. See if the widget updates correctly.
          Hi Max Mittelstädt, it is not intentional. Its just the test. "Cast To xxxGame mode command" is not working. I don't understand the reason.

          I just want to write on widget my "current points" variable can you send a link tutorial? I search or watching some tutorial but I cant see any result.
          Last edited by bsaridede; 09-09-2019, 11:08 AM.

          Comment

          Working...
          X