First, create an actor class.

In the actor's BeginPlay function, create a new ActorLocationOctreeObject node and store it.

Then, set the variables in the ActorLocationOctreeObject, such as the actor type that needs to use the Octree. Once set, you can call Begin(), and you can also set the maximum range of the Octree.

In Tick, call the Tick() function of the ActorLocationOctreeObject to drive the Octree update.
In End, call the End() function of the ActorLocationOctreeObject to correctly finalize the work of the ActorLocationOctreeObject.


Then, create a class to use the Octree actor, or you can directly implement it in the place you need.

In this class, create a variable of the OctreeActor type, and enable visibility (eye icon) so you can select the placed Octree actor object in the world.


Afterward, you can use the GetNearlyActor function of the ActorLocationOctreeObject.
You can also use the GetNearlyVisibleActor function.
