Modular Widget + Blueprint Combo

Hello Guys,

I’m having some trouble trying to make a modular BP + Widget. I’m not finding any references on foruns or youtube, probably because I don’t know exactly how to search it.
But I’m trying to create a way to change a obj in game, but when I replicate the blueprint, the widget refers to the first one, and I dont know exactly how to differenciate them from with other.

It’s a very basic setup, here are the BP and the widget as they are working right now:






Its working on this chairs, but it I replicate it on this cube for example, it changes the chair again, I undertand that it uses the same blueprint, but how could I use a variable ID, for example, to make the comunication from WIdgets to the correct blueprint


I will try to help you with this.

First I‘d like to know if by „replicate“ you mean that you‘re trying get some online functionality to work or if you are trying to apply the behaviour of the chairs onto the cube.

Currently you have two hardcoded variables, it seems, „Conj1“ and „Conj2“. In order for the Cube to change into a chair and then back into a Cube again, I‘d assume one of these variables have to reference the cube. Have you tried that?

Thanks for helping!
Sometimes it will be more then one mesh, so “conj1” or “conj2” its a scene component that contains one or more meshs that will be replaced.
And by replicated, i mean that i want to use the same BP and widget multiple times in game

In the cube image, the cube should be switched for a sphere, but for now, the widget refers only to the first BP, that switchs the chairs models like in the first images


Meshs in my BP that contains the different chair models


BP that contains the cube that should change for the sphere


Hey, hope it helps to understand my problem

So, I figured out, but i guess it isn’t the most elegant and automatic way to make it work.
But I’ve been able to figure thats better to call all the actor of class from the BP that interact with my widget and expose a variable so i can use it as the index of the BP that i need.

In my BP, I exposed a variable so i can call a different number on each BP that its used on my level, here you can see 3 of them, and later this will be used as the index to select the correct BP in the Widget - I will call it BP_ID :

In the Widget I create another open variable, called ID, thats fed by the BP_ID, and it sets the index of the the BP in my Actors of Class Array:

So back in the BP, in the event Begin Play I Set the ID ( my open variable in the widget) as my BP_ID

I guess it’s a work around, but itsn’t very smart, cause I have to manually set the index on each BP that I create on my level, and it does have to match with its order on my array too, so its easy to get messy with it.

I couldn’t figure out a way to automatically get the relation from the BP that triggers the Widget to the Widget Itself so I could get that index to work proper and automatic.
Hope thats clear to anyone, and if you guys have any ideia of how to improve it, I would be glad to know !
Thanks

1 Like

Now I did figure it all out.
I just Added this to my BP, so it would always get itself index and send it to the widget

So now it wont need to manually set the index, it solves by itself

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.