How do you use the Buoyancy plugin?

I understand that the Buoyancy plugin is experimental, but how do you actually use it?

It looks like a more general purpose Buoyancy system that operates at the level of the chaos bodies, which seems considerably more broadly applicable to say the pontoon based Buoyancy, which is full of its own issues.

I enabled the plugin, ensured the channels are set up, and nothing ever happens.

After some debugging, I noticed that

  • FBuoyancySubsystemSimCallback::TrackInteractions is called, and it iterates all the water body actor “particles”
  • The GetMidPhases never returns anything for the iteration range, so it never gets into the Loop over the midphases block

Chaos::FMidPhaseModifierParticleRange MidPhases = MidPhaseAccessor.GetMidPhases(WaterParticle);

I noticed that

UBuoyancyRuntimeSettings::CollisionChannelForWaterObjects is copied to the buyonancy settings via BuoyancySettings.WaterCollisionChannel = InSettings->CollisionChannelForWaterObjects, but WaterCollisionChannel is never used anywhere.

What does one have to do to get this system to see midphase collisions?

Hi Jeremy,

Probably the easiest thing to do here is to send a sample project using the vanilla version of 5.5 which shows the setup you have currently, and we can fill in any gaps from there.

All the best

Geoff Stacey

Developer Relations

EPIC Games

Not a problem Jeremy,

If you are blocked on an issue involving physics materials, please feel free to open another case and we can look into a way to help - but as you say unfortunately that isn’t able to have polymorphism.

All the best

Geoff

Ok my bad. In trying to make the test case, turns out the issue was that our collision profile for water is set to query only, not physics.

Disregard. It works.

Now I just wish physics materials could be subclassed.