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
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
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 :
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