Announcement

Collapse
No announcement yet.

How to Cast To Widget and Actor Classes?

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

    How to Cast To Widget and Actor Classes?

    Hey,

    I need to Cast To My Widget for a Custom Event. I know another way but I want to know the solution for this:

    Click image for larger version

Name:	CastToWidget.PNG
Views:	1
Size:	23.5 KB
ID:	1212132

    What goes to object for Widgets?

    And when I want to cast to an Actor I have the same problem

    Click image for larger version

Name:	CastToActor.PNG
Views:	1
Size:	17.4 KB
ID:	1212133

    What goes to object

    #2
    Originally posted by Glypton View Post
    Hey,

    I need to Cast To My Widget for a Custom Event. I know another way but I want to know the solution for this:

    [ATTACH=CONFIG]131246[/ATTACH]

    What goes to object for Widgets?

    And when I want to cast to an Actor I have the same problem

    [ATTACH=CONFIG]131247[/ATTACH]

    What goes to object
    When you use node "create widget", output "return" is what you have connect to cast node input "object"... did you mean this?
    Its same with actor...

    Comment


      #3
      This is already created in HUD. Now I need to cast it in the Player Blueprint. Without something connectet to object it doesnt work.. For example if you cast to a character then get player character goes to object.

      Comment


        #4
        Originally posted by Glypton View Post
        This is already created in HUD. Now I need to cast it in the Player Blueprint. Without something connectet to object it doesnt work.. For example if you cast to a character then get player character goes to object.
        so if i correctly understand, then you can try to call event from player to HUD and in HUD run logic for you widget. In player BP -> get hud -> cast to your hud -> call event which will do something with wiget

        Comment


          #5
          it works! thanks! so I just need to now how it works for actors! I need variables from different actors so I need to know how to cast to them. I would really appreciate it!

          Comment


            #6
            Originally posted by Name368 View Post

            When you use node "create widget", output "return" is what you have connect to cast node input "object"... did you mean this?
            Its same with actor...
            Just for prosperity...

            I made a custom event node in my widget to play an animation. Having a hard time finding the target 'object' in cast to event.
            Used a 'Get all widgets of class' node before the custom event node. Plugged 'found widgets' into the object.

            Comment


              #7
              Prosperity? Live long and prosper?
              Maybe you meant Posterity...

              Either way casts are by nature very temperamental. Often times they even invalidate on object renames.

              Comment


                #8
                Originally posted by MostHost LA View Post
                Prosperity? Live long and prosper?
                Maybe you meant Posterity...

                Either way casts are by nature very temperamental. Often times they even invalidate on object renames.
                Lol, you got me. English is my native language. (Oh that's bad, I shouldn't admit it)

                Comment


                  #9
                  Don't worry, I only catch these because English is NOT my native language :P

                  Comment

                  Working...
                  X