# RepNotify for offline single-player games?

**URL:** <https://forums.unrealengine.com/t/repnotify-for-offline-single-player-games/412778>\
**Category:** Blueprint\
**Tags:** unreal-engine, Blueprint, question\
**Created:** [December 20, 2017, 9:22pm UTC](https://forums.unrealengine.com/t/repnotify-for-offline-single-player-games/412778 "2017-12-20T21:22:16Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_203be311](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_203be311](https://forums.unrealengine.com/u/anonymous_user_203be311)\
**Post date:** [December 20, 2017, 9:22pm UTC](https://forums.unrealengine.com/t/repnotify-for-offline-single-player-games/412778/1 "2017-12-20T21:22:16Z")

</div>

Hello,

Is it okay to set the variable to RepNotify (in 100% single-player game) and then use its **OnRep\_[Variable name]** Function for cases where i would want to handle some logic every time the value of that variable changes?

---

<div class="post-metadata">

**Author:** ![xlar8or](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/xlar8or/32/710746_2.png) [@xlar8or](https://forums.unrealengine.com/u/xlar8or)\
**Post date:** [December 20, 2017, 9:28pm UTC](https://forums.unrealengine.com/t/repnotify-for-offline-single-player-games/412778/2 "2017-12-20T21:28:07Z")

</div>

Hey there, but why dont you use a setter function instead? Every time you want to change the value of variable X you do a SetX() that sets the value and does additional logic.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_203be311](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_203be311](https://forums.unrealengine.com/u/anonymous_user_203be311)\
**Post date:** [December 20, 2017, 9:37pm UTC](https://forums.unrealengine.com/t/repnotify-for-offline-single-player-games/412778/3 "2017-12-20T21:37:02Z")

</div>

I dont know, it seems more convenient for me, for example if i have some variable that gets changed a lot from a few different places and every time it does i want to do the same thing, its easier for me to just change the variable and let the repnotify function handle the rest.

---

<div class="post-metadata">

**Author:** ![xlar8or](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/xlar8or/32/710746_2.png) [@xlar8or](https://forums.unrealengine.com/u/xlar8or)\
**Post date:** [December 20, 2017, 9:48pm UTC](https://forums.unrealengine.com/t/repnotify-for-offline-single-player-games/412778/4 "2017-12-20T21:48:06Z")

</div>

The only difference is that everytime you change the variable instead of doing X = 2; you do SetX(2); (from the same class or from others, as long as you set the function to public) and it runs whatever update code you want in the set, so it’s kind of the same thing but more lightweight than repnotifies, but it’s up to you, if it works and it’s more convenient for you then use it, the overhead shouldnt be very noticeable.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_203be311](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_203be311](https://forums.unrealengine.com/u/anonymous_user_203be311)\
**Post date:** [December 20, 2017, 10:29pm UTC](https://forums.unrealengine.com/t/repnotify-for-offline-single-player-games/412778/5 "2017-12-20T22:29:14Z")

</div>

Thanks, i believe you answered my question.

---

<div class="post-metadata">

**Author:** ![xlar8or](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/xlar8or/32/710746_2.png) [@xlar8or](https://forums.unrealengine.com/u/xlar8or)\
**Post date:** [December 20, 2017, 10:33pm UTC](https://forums.unrealengine.com/t/repnotify-for-offline-single-player-games/412778/6 "2017-12-20T22:33:09Z")

</div>

Good to know 🙂 Please mark the answer as correct to close it 🙂

---

<div class="post-metadata">

**Author:** ![Arty-McLabin](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arty-mclabin/32/1012076_2.png) [@Arty-McLabin](https://forums.unrealengine.com/u/Arty-McLabin)\
**Post date:** [March 4, 2018, 4:31pm UTC](https://forums.unrealengine.com/t/repnotify-for-offline-single-player-games/412778/7 "2018-03-04T16:31:11Z")

</div>

In addition, RepNotify variables add 4 bytes of RAM per object, for networking logics.  
  
Keep that in mind.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_203be311](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_203be311](https://forums.unrealengine.com/u/anonymous_user_203be311)\
**Post date:** [March 5, 2018, 9:48am UTC](https://forums.unrealengine.com/t/repnotify-for-offline-single-player-games/412778/8 "2018-03-05T09:48:20Z")

</div>

Thanks for the info, i’ll keep that in mind.
