Variable gets overwritten in Tick Event

Hi,

I need to add a variable in a tick event to change a property, but it seems that the tick event overwrites whatever value I have set in my variable for it’s default value.

I’m setting a variable using a Function on an actor blueprint.

345538-set-variable-with-function.png

It gets the value from a Widget:

If I print the variable from the Function panel it works (it goes from 0 to 1 by moving a slider):

But if I print the variable from the event tick (where I need to use this variable), it seems it gets overwritten by the variable’s default value (1.0), instead of the value set by the slider (you can see it uses the the value from the slider between some ticks):

Here’s where I want to use my variable “Wind Strength”:

If I remove the variable and input a value by hand it works, but if I use a variable it gets constantly called it’s default value. I imagine there’s an order of operations that could fix this but I don’t know where.

Any help is much appreciated!

ha great question! there about 12 cables, and now that you mention it I realize it’s not getting overwritten, but instead it seems the other cables aren’t getting the variable.

I’m using a parent class for setting the cable forces, and then in the editor I’m using a child of that parent, copied 12 times.

Yes! that was it, I was using a GET with index 0 to get the cable function, so it only applied it to one instance, changing it to a For Each Loop fixed it,

thank you ClockworkOcean!

How many cables are there?

Jolly good :slight_smile: