# Tick reset variable

**URL:** <https://forums.unrealengine.com/t/tick-reset-variable/1888188>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, Blueprint, question\
**Created:** [June 3, 2024, 11:33pm UTC](https://forums.unrealengine.com/t/tick-reset-variable/1888188 "2024-06-03T23:33:31Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![ichopon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ichopon](https://forums.unrealengine.com/u/ichopon)\
**Post date:** [June 3, 2024, 11:33pm UTC](https://forums.unrealengine.com/t/tick-reset-variable/1888188/1 "2024-06-03T23:33:32Z")

</div>

When game loading level it sets game date, but it resets when tick starts

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/b/a/9baaff73c1d06c5790e8bf94dcb3372954b7072e.png)

---

<div class="post-metadata">

**Author:** ![ichopon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ichopon](https://forums.unrealengine.com/u/ichopon)\
**Post date:** [June 4, 2024, 9:24am UTC](https://forums.unrealengine.com/t/tick-reset-variable/1888188/2 "2024-06-04T09:24:48Z")

</div>

is there a solution?

---

<div class="post-metadata">

**Author:** ![ichopon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ichopon](https://forums.unrealengine.com/u/ichopon)\
**Post date:** [June 4, 2024, 11:49am UTC](https://forums.unrealengine.com/t/tick-reset-variable/1888188/3 "2024-06-04T11:49:24Z")

</div>

i wanna add that if i set date manually it works, but if i connect variables to set date its just resetting it to default

---

<div class="post-metadata">

**Author:** ![Nightwolf](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nightwolf/32/917179_2.png) [@Nightwolf](https://forums.unrealengine.com/u/Nightwolf)\
**Post date:** [June 4, 2024, 12:04pm UTC](https://forums.unrealengine.com/t/tick-reset-variable/1888188/4 "2024-06-04T12:04:04Z")

</div>

I’m not familiar with setClockwork, is that one you made?

One of your Custom Events there has a blue note under it, what does that say?

What do the functions Clock and Calendar look like?

My idea without the above information is that the pure node setClockwork is returning different data every time its ran

Delta Secounds will be a different number as well on different computers/depending on frame rate worth noting

Hope this helps i’d love to help you narrow it down further but need more information… or ill have to figure out SetClockwork myself if thats not user made

---

<div class="post-metadata">

**Author:** ![Arodi007](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arodi007/32/1022275_2.png) [@Arodi007](https://forums.unrealengine.com/u/Arodi007)\
**Post date:** [June 4, 2024, 12:04pm UTC](https://forums.unrealengine.com/t/tick-reset-variable/1888188/5 "2024-06-04T12:04:17Z")

</div>

Try by default set the actor tick is disabled, and enable the tick after the function SetGameDate.

Double check if function timers wouldnt be easier to use instead of tick, you can use pause/resume timer

---

<div class="post-metadata">

**Author:** ![Nightwolf](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nightwolf/32/917179_2.png) [@Nightwolf](https://forums.unrealengine.com/u/Nightwolf)\
**Post date:** [June 4, 2024, 12:10pm UTC](https://forums.unrealengine.com/t/tick-reset-variable/1888188/6 "2024-06-04T12:10:37Z")

</div>

SetClockwork Definity seems to be something you made or from a plugin, assuming it just does some math in there i’d still like to see it if ya don’t mind  
along with clock and calendar, i’ll recreate it real quick and see if i can’t find it for ya

---

<div class="post-metadata">

**Author:** ![ichopon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ichopon](https://forums.unrealengine.com/u/ichopon)\
**Post date:** [June 4, 2024, 12:10pm UTC](https://forums.unrealengine.com/t/tick-reset-variable/1888188/7 "2024-06-04T12:10:41Z")

</div>

Yeah, it’s made function

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/7/a/c7ab5acb7020db77674a7ff1aa7b8866437effc1.png)

Blue note:

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/f/9/8f9ae9fc988727bc4ce9547952099624f37ad3f4.png)

---

<div class="post-metadata">

**Author:** ![ichopon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ichopon](https://forums.unrealengine.com/u/ichopon)\
**Post date:** [June 4, 2024, 12:12pm UTC](https://forums.unrealengine.com/t/tick-reset-variable/1888188/8 "2024-06-04T12:12:13Z")

</div>

It’s already disabled by default

---

<div class="post-metadata">

**Author:** ![ichopon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ichopon](https://forums.unrealengine.com/u/ichopon)\
**Post date:** [June 4, 2024, 12:15pm UTC](https://forums.unrealengine.com/t/tick-reset-variable/1888188/9 "2024-06-04T12:15:17Z")

</div>

Clock:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/c/7/8c7a3f871c0dce233091c3a5578865c173f82257.png)

Calendar:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/4/4/54499d1c922a086ade9a7a46f6db05b21de42ede.png)

---

<div class="post-metadata">

**Author:** ![Nightwolf](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nightwolf/32/917179_2.png) [@Nightwolf](https://forums.unrealengine.com/u/Nightwolf)\
**Post date:** [June 4, 2024, 12:15pm UTC](https://forums.unrealengine.com/t/tick-reset-variable/1888188/10 "2024-06-04T12:15:42Z")

</div>

My guess is this is your Level BP and your using the custom event as a function called from someplace else, you can make the blue go away by making it a function

So basically not a problem if it’s not called from within this same BP, but if it is within this same Bp i mean the note kinda says what to do, but you’ll have to make those variables or pass them in wherever your calling it

---

<div class="post-metadata">

**Author:** ![ichopon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ichopon](https://forums.unrealengine.com/u/ichopon)\
**Post date:** [June 4, 2024, 12:19pm UTC](https://forums.unrealengine.com/t/tick-reset-variable/1888188/11 "2024-06-04T12:19:59Z")

</div>

i’m calling LevelLoaded in widget, after loading the level

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/1/9/1199d61cd12528bf0d7c229feb4f83cde00caa09.png)

---

<div class="post-metadata">

**Author:** ![Nightwolf](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nightwolf/32/917179_2.png) [@Nightwolf](https://forums.unrealengine.com/u/Nightwolf)\
**Post date:** [June 4, 2024, 12:24pm UTC](https://forums.unrealengine.com/t/tick-reset-variable/1888188/12 "2024-06-04T12:24:12Z")

</div>

![Screenshot 2024-06-04 072122](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/4/0/440588acff1a493eb7c29229f9f12034a6b90483.png)  
If you don’t need specifically the real date time this may help it’s a node provided by engine

> [@Tick reset variable](https://forums.unrealengine.com/t/tick-reset-variable/1888188/11):
>
> i’m calling LevelLoaded in widget, after loading the level

Yea definitely just go ahead and make that a function instead, i don’t think its necessarily causing an issue but it’ll narrow down the possibility and make the note go away

---

<div class="post-metadata">

**Author:** ![Nightwolf](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nightwolf/32/917179_2.png) [@Nightwolf](https://forums.unrealengine.com/u/Nightwolf)\
**Post date:** [June 4, 2024, 12:36pm UTC](https://forums.unrealengine.com/t/tick-reset-variable/1888188/13 "2024-06-04T12:36:42Z")

</div>

![Screenshot 2024-06-04 073535](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/2/2/922f8f3b51987ff36a60e3b2b2e6e506c17aec3f.png)  
a little something like this maybe, oh nvm i see i solved it 😅  
and pardon the spaghetti

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [July 4, 2024, 12:37pm UTC](https://forums.unrealengine.com/t/tick-reset-variable/1888188/14 "2024-07-04T12:37:40Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
