UMG Button not work in game

This is my blueprint’s event graph.
When playing, It doesn’t work.
When stop the game, Spline Actor’s Location is changed.

How can i solve this problem?

Firstly, the button is working. You know this because when you click on it, you get the print string message “Up” printed to the screen.
The reason why the spline’s location is changed is because you’re changing it. You’re using a set Actor location so you can’t pass through 0s to mean “Don’t change” the value. They mean set the value to nothing. So it’s moving to a location of nothing on X, Nothing on Y and 20 on Z.
Better than saying what you’re doing isn’t working (Cause technically it’s doing what you’re telling it to) how about you let us know what you hope to accomplish and we can help you from there.

i guess he wants to change the Z value when he clicks the button , but it first applies when he closes the game , not while playing.^^

Is the the code inside the event graph of your UMG or the bind for your button or in the blueprint for the spline actor?
And when/where do you add the UMG to the viewport?
Also, is the final desired result of this UMG to move the spline actor, or is this simply a test for something else? It would help if I know exactly what you want to do with the UMG button press.

so u had to make a reference to the spline actor in the HUD widget like “get all actors of class” or something then set it as new variable , right?

maybe theres some mistake`?

i reworked the issue and it works just fine for me

(Last question)
Before inquired this question, I had inquired about another question. Question link is
I want to know how to enable or disable tick event. Though It is clear that UMG’s button event is working, I couldn’t see the change in runtime .

(This question)
So I tried another test about changing actor’s location.
When playing, location is not changed. Change appears after I stop the game.
Second picture show that actor’s location isn’t changed in runtime.
Last picture show that after I click the stop button, actor’s location is changed.

I don’t know whether it is correct sentence… sorry

It is what i wants. Thank you for help.

Umm… I can test your advice after 15 hours… Because my computer is not available.

I set actor reference in advance.
My scenario is…
SpilneActor is C++ actor having click event that show UMG.
When clicking SplineActor, I call blueprint’s function named SetActor.
I checked that SplineActor reference was correctly set.
Is there a difference between set actor reference by calling “get all actors of class” in blueprint ( UMG ) and calling my custom blueprint function “Set Actor” in SplineActor (C++)?

1… It is inside my UMG.

2…I call ChangeWidget function in SplineActor’s click event. You can find it through link.

3… It is just a test.
In this case, I know the button event is working. But I want to know change SplineActor’s location in runtime not after playing.
Finally I want to know how can I enable / disable the tick event in spline actor.

Oh… Link additionally contain dot…

Here is correct link.

so u have ur mouse enabled, clicking on the “bridge” then the umg opens up and u can move it by clicking up down left right and so on right?

i cant write c++ so i dont know if theres a difference between ur way and mine , it could be that theres an error linking the actor u want to move

all actors of class works this way:
you have 1 bridge , call it , make a get node (with the index 0) and set it. then u referenced it to that only bridge

IF you now have more then 1 it adds all those bridges to an array … now it belongs to the index you choose which actor will be setted

Thanks Erytriel!. I will test your way first.

umm… But I has many Spline actors.
How about check index in c++ and send index to blueprint?
Then, umg can call “get all actors of class” by correct index.
I will test it too.

If you have a lot of spline actors you can store them in an array. I think this would be the same as an index.

It is working well. Erytriel,TorQueMoD Thank you for help.

np. You should mark Erytriel’s answer as correct

np, this would be nice :>

This is really helpful, Thanks for this you also check