float doesn't update




I’m trying to make a tower defense game and get the target mode first.
I came to the problem that my float Best Distance always stays on 34 even when I change it to 0.
Pls help, I have been working on this for hours.

It’s pretty hard to help you just with a bunch of screenshots with text too small to read

If you haven’t already i would suggest putting a breakpoint in your blueprint somewhere near the start and stepping through it block by block to make sure it does what you think it is doing.

maybe you override it f.ex. on Tick or any other place that updates every frame?

If you are sure that the code is running and you actually change the value (you can confirm that with printstring at the point where you set the values) and it still remains same I assume it’s being overriden somewhere

Right Click on your Float Variable and ‘Find References’, check your code and make sure it’s not overriding it at all times as mostly such issues are simply a wrong organization/workflow of the code

1 Like

Thanks it works now, I had A c++ variable and blueprint Variable with the same name, and I was setting the blueprint one in the beginning.

1 Like