Change static mesh to other object with UMG button
Hello I am still new in using the Unreal Engine. I start my project with the shooter starter content. After follow a tutorial, I am able to change the static mesh object to another by shooting. This is the blueprint how I set. I want to change the current static mesh object to another by using the UMG button and this is my blueprint. But the button is not working. I know the "cast to destructive wall" need an object reference. In the event hit, the "other" pin will detect whether the object hit is same as the object references cast to. In the UMG button, What should I do to detect and get all the object match to the "cast to destructive wall"? How to change the static mesh to another by only click a button? Really appreciate if get any help or advice!
asked Nov 28 '18 at 04:00 PM in Blueprint Scripting
In the first two images, you know that your projectile is actually hitting something, and therefore the
In this case, where you want to change a static mesh of some actor, the widget doesn't know what actor to change the static mesh on, unless you tell it. You can create a new variable on the widget, and make it of type
I've marked the interesting things with orange. You're welcome to ask any questions regarding this solution, and I'll do my best to answer them :)
answered Nov 28 '18 at 04:20 PM
I figured out why my button doesn't work. Because the object reference did not specify which object is want to change (it is possible to have many same objects). After the object is defined as an array index '0', the static mesh can be set!
answered Nov 29 '18 at 04:21 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here