Announcement

Collapse
No announcement yet.

How to link static mesh into widget blueprint?

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

    How to link static mesh into widget blueprint?

    Been having this problem and i couldn't solve it. What i intended to do is to change the material via the widget blueprint but i am unable to bring the static mesh actor into the blueprint. How do i solve this??

    Click image for larger version

Name:	sadas.jpg
Views:	1
Size:	353.0 KB
ID:	1149461Click image for larger version

Name:	dsadsa.jpg
Views:	1
Size:	392.7 KB
ID:	1149462

    #2
    How are you bringing the widget up?

    If you are clicking on an actor that brings up the widget; create an actor variable in the MenuCC widget. Then,In the Actor BP, after you create the MenuCC widget, cast to MenuCC, and set the actor variable with a reference to it self, then add to viewport.

    Hope this helps!

    Comment


      #3
      There's no problem bringing the widget up. It's already done. My problem is just bringing the mesh actor into the widget blueprint to define the mesh that will be undergoing a material change.

      Click image for larger version

Name:	sfagehw.jpg
Views:	1
Size:	451.3 KB
ID:	1075878

      Comment


        #4
        I understand that the widget is already on screen, but how was it put there? Is it placed when the level starts? Was it done by clicking an actor? Is it brought up on a button press? This can effect how you do things.

        If the widget is always up you should set a reference to it in your character/pawn so that you can access it easily.

        Now the question is, what actor are you trying to reference? Is it the player? An actor somewhere else? If so, how are you choosing that actor? Are you clicking on it, looking at it with a trace, overlapping it, randomly selecting acotors in an array? However, that is done, on that selection event, you need to send the actor to the widget using a cast to MenuCC and set the desired var.

        Comment


          #5
          Oh sorry. I misunderstood what you said. The widget opens when i click/press on the object. It is done via the object blueprint (eventgraph).
          I'm trying to reference the object as i'm trying to change it's material via selection menu (widget).

          Therefore i'm currently stuck at defining (referencing) the same object into the widget blueprint (pointed with the red arrow in the SS). I have no clue how to bring it into the widget blueprint.


          I hope this makes my question clearer.

          Comment


            #6
            Bump... need help...

            Comment


              #7
              Sunny, it is just like I said before.

              Here are some bps. Very simple. Click button, change var in actor and call function in actor. Better to do the changing in the actor blueprint. I put a delay before removing it but it is unnecessary.

              Click image for larger version

Name:	changeMats.PNG
Views:	1
Size:	435.3 KB
ID:	1075997

              Here is the actor bp. On click, create widget, cast to that widget type that has a place for the actor to be stored. Store var in the widget for use when a button is clicked and add the widget to the viewport.

              Change color function is called from the widget after it set the current material var to the desired color.

              Click image for larger version

Name:	change02.PNG
Views:	1
Size:	387.3 KB
ID:	1075998

              Comment

              Working...
              X