Announcement

Collapse
No announcement yet.

Casting in UMG

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

    Casting in UMG

    Hello,

    I'm having problems casting into a UMG HUD.
    My objective is get a X value from an AI character and display into the HUD.
    I do with no problems with the player character, but when i'm doing with the AI, the HUD is not updating and I think is because of a bad casting. Doing some debug i verified the function i created (same as the player) is working fine and the only problem, like i said, is displaying the value into the UMG HUD.
    So... what is the correct way to cast an AI in the Event Contruct of any UMG?

    Thanks in adavance.

    #2
    Casting should not be different, do it in the binding function. Can you post a pic of your blueprint?

    Comment


      #3
      Could be a bad reference? Double check that youre pulling the values from the correct place?
      Need another dev on your UE4 project? Send me a shoutout and I'll lend a hand

      Comment


        #4
        I solved my problem. After breaking my head with no success I decided to do the job using my game controller. It's not like I have in mind but do the same.
        Anyway, thanks for your help.

        Comment


          #5
          i would like to know where and how to set reference of UMG variable to cast it to other blueprint.
          i tried several time and didnt work for me

          Comment


            #6
            @SimonRail

            What do you mean? You can't cast something to a Blueprint that it isn't, that will fail.

            Comment


              #7
              i want to cast a variable out of my UMG to my gamemode, how can i do that.
              the only "get" from a cast object is "get gamemode" or "get character controller" etc..

              Comment


                #8
                GameState might be what you are looking for, instead of GameMode.

                If something isn't globally available, you can pass it as a function argument.

                Comment

                Working...
                X