Invisible actor does not load on client

In my game, I have an actor blueprint class that is invisible at runtime but it is an indicator of that the game is fully loaded, and when it is loaded, the loading widget disappears. But on UE5 that actor is never loaded on clients, and the widget stays forever. Here is the screenshot that shows that there are four such actors on the server (they are in the different places of the world) but there aren’t they on client. How to fix this?
EDIT: I cannot uncheck “Is Spatially Loaded” because in that case these actors would load at the start of the loading and all four at once, whereas I need them to load near the end of the loading process and only in the given distance.

How are you checking Loading?
Did you replicated the actors?

Spatially loaded is based on cell size and your proximity to it. If you aren’t close enough to spatially load the cell → actors in cell it’ll never load.

@Ivan3z I check loading every second starting from Begin Play in the above-mentioned actor. The actors are replicated automatically as they are placed in the map at the editor time.
@Rev0verDrive Well, how to set the distance at which actors load?

What is your “Check Loading” macro doing? You say the actor is never loaded on the clients…how do you know this? Are you saying that because the loading message never goes away?

An easy way to check is to add a static mesh to the actor so you have some visible representation.

@gh0stfase1 Here is that macro. I know that the actor is never loaded because there is shown on the first screenshot that there are four actors on the server and none on the client. Static mesh is not an easy way because that actor is very far from the main actions zone. I think all I need is to set the distance at which those actors are loaded. But how to verify this guessing?

The way I typically do it in large maps (8x8km+) is to use a custom pawn for loading (default pawn class).

image

When a player connects the server will create a controller for the connection. I immediately load a UI loading screen via the controller.

I let the server do it’s default handling of connections and spawn/possess the default pawn. This pawn does not have any movement so it floats. No worries about falling through the unloaded map.

Once the pawn spawns locally I use a timer to execute loading checks.
Sphere trace a large area for specific objects. In your case you could do one that looks for your specific actors. When it gets 4 you know those areas are ready.

Get actors of class → Length = 4 would work as well, but it’s more expensive on large maps.

I then follow up with a line trace down to detect floor/landscape etc, so that when the actual pawn is spawned there’s a floor to land on.

When these checks clear I call an event on the controller (Run on server).

In the player controller I call an event in the game mode to spawn the legit pawn class and possess it.

image


This is just a simple example.

@Rev0verDrive This is good, but that actor checks not loading the pawn but loading the map. And sphere trace won’t help because there isn’t the needing actor in the client’s world at all. In the UE4’s World Composition, there was a setting that changed the max “draw” distance for all the actors in the LandscapeProxy. I do not remember its name but it was at the top of the window where I had loaded and unloaded the proxies using the minimap. Is it possible to get something similar in the UE5?
EDIT: I have just read that it was named “streaming distance”. What is the analog in the Unreal Engine 5?

This is good, but that actor checks not loading the pawn but loading the map.

This is exactly what my faux pawn does. It checks if the level is loaded, so that the real pawn can be loaded. Without these checks the “real pawn” is immediately spawned by the GM when the player connects to the server. As such the pawn would fall through the map…because the level isn’t loaded on the client.

My Faux pawn checks if there are specific actors loaded. When that specific check clears (true) it then verifies the landscape component below the faux pawn is loaded. Thus substantial portions of the map are loaded. Enough so that it is safe to spawn the actual pawn.


Level Streaming Distance is what you’re referring to in World Comp.

It’s Loading Range (cm) in combination with Cell Size (cm) for World Partition.

LR determines the range from a streaming source where cells are loaded. Default Loading Range is a 768 meter radius around a streaming source.

Setting the Loading Range and the Cell Size solved the problem! Thank you very much for the #9!

Careful with those. They will have an impact on overall performance.

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