Adding a component at runtime (Water Plugin)

I need to add a component in the character BP when it overlaps something. My game has world composition in ue 5.2. Water plugin interacts with the character, and it works even though water is not Z0…, but because the world is big, this tile gets unloaded. When I reload the level and go back into the water, I can’t interact with my component in the character BP because WaterBodyLake was unloaded and the BP_Dynamic_Force_Component and the new WaterBodyLake don’t work together. So I think I might load the tile level, and add BP_Dynamic_Force_Component in Character and WaterBodyLake in outliner at once. (I know, world composition is depredicate, but is the best solution for what I want).
How to load BP_Dynamic_Force_Component in Character at runtime, e.g. when the level with water is loaded ? Is there another solution?

Hey @redgiantstar.com! Welcome back!

I would suggest keeping that component on the character, deactivated as default. Then you can activate the component as part of the code! It would be much harder to add a component at runtime and load it in on the fly.

Hope that helps!

Thanks for the tip. Can you tell me how to deactivate this component? And how can I activate it again? My attempts have not helped…

Hey @redgiantstar.com! Sorry for the late reply!

One thing I will note is that often if you have more than one thing plugged in as target to a node like this, you will get strange behavior, often it will pick one at random. You need each component to have its own activate node.
I would suggest making a function “F_ActivateBuoys” and “F_DeactivateBuoys” for screen space.

Anyway, you say it is not working- you will need to give us more than that, we don’t know what information we’re supposed to be seeking here. Are the print strings going out?

Hey @redgiantstar.com!

Did you find the solution?

Let us know so others that have this problem can find this, as well!

No, I have opened a new thread as the solution should now be different. See new thread:

https://forums.unrealengine.com/t/how-do-i-set-waterbodylake-invisible-when-level-is-unloaded-in-word-composition/1971352

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