Download

Set variable each Tick

Hi, I’d like to add Delta value to my variable “Test”, each Tick.
I want to be able to reset it each time I click.

You can see a log on the left (I click at 5.488).
It seems like the variable is always switching between 2 values :

  • The value which has been reset
  • The value which hasn’t been reset

Can someone explain me what’s happening pls ?

Thank you in advance

You’re printing the value before it’s being added to. Try printing it after it’s been added to and see what you get.

You’re absolutely sure there’s nowhere else you’re affecting “Test”? Right click the variable in the My Variables pane and find references and uncheck “This blueprint only” in the search results then press enter after clicking in the search field.

Even by printing the value after the result stay the same. I created this variable “Test” just for this example and I don’t use it anywhere else.

I tried to reproduce this blueprint in an empty project and I don’t have any problem.
I can’t understand what’s wrong in my current project.
I attached the result of the research, I also indexed and pressed enter after cliking in the search field.

Have you tried just printing delta seconds? Also I thought delta seconds is just the time between frame or something like that. Resetting each frame?

Printing delta seconds display about 0.008
I tried without delta, and simply add 0.1, and I also printed before and after the set.

The result is the same, it’s like I’m printing 2 differents variables.
Does someone already met this problem ?

Looks like there are 2 blueprints ticking. Here’s a quick way to find out:

Right click, get a reference to “self”, drag out a wire and get “display name” or “object name” then feed that into the print node. You can also use an “append” if you want to add the float as well.

Thanks you’re right. The problem was I’m using 2 times the same blueprint. :frowning: