Can you re-parent the level BP to a custom BP?

Hi, I’m trying to have similar functionality in all level blueprints, but I want to be able to easily change code in all of them from one place, like a parent BP. I’m trying to do this with streaming levels. Is there a way to do this?
Thanks.

1 Like

If you want to do anything interesting with blueprints, the basic rule of thumb is avoid the level BP.

If you want some sort of overarching control from blueprint, then the game instance is a much better place.

1 Like

Thanks. But I specifically need the streaming level to get its own actors transforms, to pass to the GI, for saving. Seems like the cleanest way to do it, because the streaming level only knows about its own actors.
Is there any particular reason not to use level BP?

Many, including

  1. You can’t talk to it ( not without a lot of effort )

  2. It’s not a portable solution. Why bother coding something in the level BP, if you just have to code it again, in another. An actor BP placed in the level would be better than that.

  3. You can defintely write a more elegant BP solution to saving actor details in streaming levels, without using the level BP. For staters, BP ( and CPP ) is object orientated. That means the objects should know how to save themselves. Using the level BP is almost like coding in FORTRAN when you can make an object solution :slight_smile:

1 Like

Well, I tried using the actors themselves first. I want their transforms to be saved when the level is unloaded, so I use the level’s ‘onEndPlay’. If I use the actor’s ‘onEndPlay’, they also save when they are destroyed, even if the level is still loaded, which I don’t want.

How are you doing the streaming? If it’s volumes, you have no signal really that the level is unloading.

It may be a good idea to just save details as they change. It’s also more performant.

1 Like

I’m streaming levels through widget (button loads/unloads level), at the moment. Later, I will probably be using streaming volumes as well.

Wouldn’t that be more costly, to save on every change, when it’s not necessary?
How would you even do it? Actors don’t have an ‘Event Construct’.

1 Like

If you changing on button press, then you know when it’s going to happen, and can save everything.

It makes more sense to save when there’s a change, rather than doing a great big ‘lump’ and the end of the level.

The actors need to be blueprints. They can save themselves when the change occurs. ( but it really depends what’s happening, what kind of ‘action’ you have going on )

1 Like

These actors are just items the player can collect. They have physics enabled, so they might change their position often, or not, depends if the player or other actors bump into them.
But again, how do you save on every change?

1 Like

Ah, that’s more tricky, that’s why I asked :slight_smile:

When the player collides with something, it knows. Can you use this to trigger a save for the object you just walked into / picked up?

1 Like

I guess I could use ‘onActorHit’, but it’s not ideal, because I assume it triggers when the hit initiates, and I need to save the position when the actor stops moving, because that would be its final position where the player expects to find it, next time.

1 Like

Something like that. I never use physics, so I’m afraid we’re moving out of my knowledge area… :joy:

1 Like

I wonder if there’s blueprint access to this?