Use

中文

First, create an actor class.

image.png

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

image.png

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.

image.png

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.

image.png

image.png

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

image.png

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.

image.png

image.png

Afterward, you can use the GetNearlyActor function of the ActorLocationOctreeObject.

You can also use the GetNearlyVisibleActor function.

image.png