# How do I use a if statement to check if a function is active and set a function to active and inactive?

**URL:** <https://forums.unrealengine.com/t/how-do-i-use-a-if-statement-to-check-if-a-function-is-active-and-set-a-function-to-active-and-inactive/1760436>\
**Category:** Verse\
**Tags:** unreal-engine, unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [March 18, 2024, 1:48pm UTC](https://forums.unrealengine.com/t/how-do-i-use-a-if-statement-to-check-if-a-function-is-active-and-set-a-function-to-active-and-inactive/1760436 "2024-03-18T13:48:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kelan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kelan](https://forums.unrealengine.com/u/Kelan)\
**Post date:** [March 18, 2024, 1:48pm UTC](https://forums.unrealengine.com/t/how-do-i-use-a-if-statement-to-check-if-a-function-is-active-and-set-a-function-to-active-and-inactive/1760436/1 "2024-03-18T13:48:17Z")

</div>

How do I use a if statement to check if a function is active and set a function to active and inactive?

---

<div class="post-metadata">

**Author:** ![Astrotronic](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/astrotronic/32/1194566_2.png) [@Astrotronic](https://forums.unrealengine.com/u/Astrotronic)\
**Post date:** [March 18, 2024, 3:54pm UTC](https://forums.unrealengine.com/t/how-do-i-use-a-if-statement-to-check-if-a-function-is-active-and-set-a-function-to-active-and-inactive/1760436/2 "2024-03-18T15:54:06Z")

</div>

Hi Kelan, Welcome to the Forums.

I did this [Timer Tutorial](https://dev.epicgames.com/community/learning/tutorials/2JK9/fortnite-verse-custom-countdown-timer) yesterday. I think that using a ‘logic’ variable in a similar way will help you with this.

---

<div class="post-metadata">

**Author:** ![BdawgsLit](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BdawgsLit](https://forums.unrealengine.com/u/BdawgsLit)\
**Post date:** [March 19, 2024, 10:21pm UTC](https://forums.unrealengine.com/t/how-do-i-use-a-if-statement-to-check-if-a-function-is-active-and-set-a-function-to-active-and-inactive/1760436/3 "2024-03-19T22:21:08Z")

</div>

If its a somewhat simple trigger logic you could try using a switch as a ‘if statement’ I’ve used this visual logic successfully before. Set the switch to on when the countdown starts, and off when it ends/stopped and then whatever you’re trying to trigger you can check if the switch is on or off ie. Found this to be very simple and no need for a verse device for such a simple logic

---

<div class="post-metadata">

**Author:** ![Kelan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kelan](https://forums.unrealengine.com/u/Kelan)\
**Post date:** [March 21, 2024, 9:28am UTC](https://forums.unrealengine.com/t/how-do-i-use-a-if-statement-to-check-if-a-function-is-active-and-set-a-function-to-active-and-inactive/1760436/4 "2024-03-21T09:28:57Z")

</div>

This is a great tutorial and I was able to get what information I needed. The solution I found was “var VaribleName : logic = true” and then using “set VaribleName = false” or “set VaribleName = true” throughout my code and using if statements to check if it was true “if (VaribleName?):” Thank you 🙂

---

<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:** [April 20, 2024, 9:29am UTC](https://forums.unrealengine.com/t/how-do-i-use-a-if-statement-to-check-if-a-function-is-active-and-set-a-function-to-active-and-inactive/1760436/5 "2024-04-20T09:29:55Z")

</div>

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