Hi, what’s the best way to do this? Thanks.
I think you’ll probably find, the player is always in the persistent.
Thanks. Yeah, I know, but I need to know which streaming level’s boundaries they are occupying at one given time.
I’m surprised such a basic thing has not been implemented in the engine.
I think you have to cook it yourself, and it really depends on how you’re using streaming.
For instance, if you’re using streaming volumes, you could be in several at once, so how does that work?
If you’re just streaming one level at a time, you can just keep yourself. Also a valid option.
Make a TMap of all the level proxies. Do a trace and return the hit proxy.
Thanks. But what if the trace hits a level that the player is not in?
Is there a way to get streaming level bounds and check if player character is in it?
I’ll be using both volumes and blueprint streaming throughout the game.
You’d have the player do the trace and report back.
Or do a Large sphere trace to get the player location then trace from that location.
So, I made this in a streaming level blueprint:
I’m getting the bounds of all Static Mesh Actors in my streaming level, and then trying to see if the player character is inside those bounds.
And, even though I see the coordinates of the player are close to the ones of the box bounds center, the ‘If’ condition in the Tick is never True.
What am I doing wrong here? Please, help.
I don’t think this will work, the mesh is often totally contained in the bounds, unless it’s at a strange angle, and so the player will never be in the box.
What about having a player start in each level, with the level name in a tag. Then you can look just for player starts, and find out which one you’re closest to?
I thought about it, but you can still be closer to a player start that doesn’t belong to the level you’re in. If, for example, you’re within the bounds of a big level, but there’s another smaller level just near you.
But here, I’m just trying to see if a point, not a mesh, is within the box. It should work, right?
You’re right. But I just tried it, and it works…
Ah - point in box, not vector
Also, no need to cast…
Yesss, it works. I was using “Is Vector Inside (Box)”, because that’s what shows up when you search “is inside”. I didn’t even think to search for point.
Thanks a lot.
You could mark certain actors in each level with tags. That way, you only have to check a few actors instead of all of them
Great idea. I was mainly looking for a way to find out if player is inside level, without me doing any manual work. But I might still use the info. Thanks.
Now, if I could only find out which type of actors to look for in the level to get the proper bounds. Because, right now, if I get all actors of class “Actor”, my bounding box ends up being really long in height, for some reason.
Maybe you have the landscape or sky in there?
Have you tried just static mesh?
Yes, just Static Mesh Actors gives me the right box. But what if I have actors which are not static meshes, that I want to encompass?
I printed an array of the actors, and besides all the actors I placed, I’m getting another 2: the level itself and a brush actor. Apparently it’s the brush actor that causes it. If I remove it from the array, it’s all good. Don’t know if there’s a way to not get it in the first place.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.