# Add pontoons in runtime

**URL:** <https://forums.unrealengine.com/t/add-pontoons-in-runtime/476996>\
**Category:** Rendering\
**Tags:** Water, ocean, unreal-engine, question\
**Created:** [January 9, 2021, 8:05am UTC](https://forums.unrealengine.com/t/add-pontoons-in-runtime/476996 "2021-01-09T08:05:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ra1na5](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ra1na5](https://forums.unrealengine.com/u/Ra1na5)\
**Post date:** [January 9, 2021, 8:05am UTC](https://forums.unrealengine.com/t/add-pontoons-in-runtime/476996/1 "2021-01-09T08:05:17Z")

</div>

Hey guys! For UE’s new water system (4.26), I would like to know if it is possible to add/move buoyancy points (pontoons) dynamically during runtime via blueprints or C++ (without editing source files). Thanks 🙂

---

<div class="post-metadata">

**Author:** ![LordStuff](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LordStuff](https://forums.unrealengine.com/u/LordStuff)\
**Post date:** [September 29, 2021, 12:44am UTC](https://forums.unrealengine.com/t/add-pontoons-in-runtime/476996/2 "2021-09-29T00:44:28Z")

</div>

Late answer but still, I tried this today and it is actually very easily possible!

To do it, add a new C++ class that inherits BuoyancyComponent.

To your new class, add a function like so:

```
 UFUNCTION(BlueprintCallable, Category = Buoyancy)
  void AddPontoon(FName PontoonCenterSocket, FVector PontoonRelativeLocation, float PontoonRadius) {
	FSphericalPontoon pontoon = FSphericalPontoon();
	pontoon.CenterSocket = PontoonCenterSocket;
	pontoon.RelativeLocation = PontoonRelativeLocation;
	pontoon.Radius = PontoonRadius;
	BuoyancyData.Pontoons.Add(pontoon);
}

```

Inside blueprint, use your new component instead of the standard Buoyancy Component and Add Pontoons dynamically!

 ![349561-pontoon.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/b/e/6beb806b2c233d5e1f3dac6876924402f59a2bad.png)

According to my tests so far, you can even add them after activation. The AutoActive is kinda buggy though, so I keep it off and Activate the Component through blueprint. Deactivate works too.

I also tried to pass the FSphericalPontoon struct directly into the function which kind of worked at first, but everytime I restarted the engine, it recombined the pin and saw the node as error, and after refreshing it twice and again splitting the struct pin, I had to reenter everything. I think having it pass only primitives is fine too.

Should be able to implement a delete function too or maybe even expose the Pontoons array through a getter directly so you can directly manipulate it in blueprint.

---

<div class="post-metadata">

**Author:** ![stefanmaco](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@stefanmaco](https://forums.unrealengine.com/u/stefanmaco)\
**Post date:** [July 18, 2023, 10:48pm UTC](https://forums.unrealengine.com/t/add-pontoons-in-runtime/476996/3 "2023-07-18T22:48:22Z")

</div>

works perfectly, thank you. Those were also my first lines of C++ in unreal and I will use it more often from now on, it’s really simple after you get the hang of it. Also I can solve a bug with physics constraints too so hooray

---

<div class="post-metadata">

**Author:** ![Grot13](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/grot13/32/1008648_2.png) [@Grot13](https://forums.unrealengine.com/u/Grot13)\
**Post date:** [October 19, 2023, 5:01pm UTC](https://forums.unrealengine.com/t/add-pontoons-in-runtime/476996/4 "2023-10-19T17:01:18Z")

</div>

Isn’t there a way to do it with blueprint now? I wish this function was built in.  
I have tried this method but I can only get datas :

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/2/5/c251b0e5cc8463b092da104162bc60e78e0c0118.png)
