# Community Tutorial: 30 - Refactoring the Function Library - Let's Make a Tower Defense Game

**URL:** <https://forums.unrealengine.com/t/community-tutorial-30-refactoring-the-function-library-lets-make-a-tower-defense-game/2251151>\
**Category:** Tutorial & Course Discussions\
**Tags:** unreal-engine\
**Created:** [December 30, 2024, 9:18pm UTC](https://forums.unrealengine.com/t/community-tutorial-30-refactoring-the-function-library-lets-make-a-tower-defense-game/2251151 "2024-12-30T21:18:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlamarsDomain](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AlamarsDomain](https://forums.unrealengine.com/u/AlamarsDomain)\
**Post date:** [December 30, 2024, 9:18pm UTC](https://forums.unrealengine.com/t/community-tutorial-30-refactoring-the-function-library-lets-make-a-tower-defense-game/2251151/1 "2024-12-30T21:18:38Z")

</div>

This Unreal Engine 5.4 video is about refactoring how the function library is accessing the Managers.

We start by complaining about how slow Get All Actors of Class is, and how bad calling it from Tick would be. Next, we add the Managers as variables to the Game Mode Blueprint, which we set in the respective managers Begin Play Events. We also Get the Game Mode inside the Function Library, and talk a little about the World Context.  
  
[https://dev.epicgames.com/community/learning/tutorials/PYyV/unreal-engine-30-refactoring-the-function-library-let-s-make-a-tower-defense-game](https://dev.epicgames.com/community/learning/tutorials/PYyV/unreal-engine-30-refactoring-the-function-library-let-s-make-a-tower-defense-game)
