Hi, first of all, totally new here, and totally new to UE5 - sorry for not including proper question/bug-report bells and whistles like videos, versions, logs, and whatnot.
TLDR:
UE 5.2.1
Seemingly randomly, as a result of changes to pontoons (number, positions - using mesh sockets), your floatable thing (object? mesh? blueprint class?) will either work just fine and float, or break in two different ways:
a. ignore water completely, sink to the bottom and exhibit collision physics with the seafloor
b. as it’s falling down (from initial position just above water), it will ignore all pontoons until a certain point through the fall (cca when water level halfway up the mesh), and then suddenly catch one of the pontoons (having ignored other pontoons while in the process of entering the water previously), spaz out like crazy, and (in my submarine’s case) stand end-on, clearly being floated by at least one pontoon somewhere in the middle of the mesh
Conclusion: issue clearly linked to pontoon placement (and inexplicably also caused by offsetting center of mass of the mesh), but could not figure out how exactly.
Theory 1 was exceeding max number of pontoons (at cca 32 pontoons), because deleting pontoons in the middle of the mesh fixed it. But the same problem cropped up again with the lower number of pontoons later (after tweaking center of mass offset).
Theory 2 was positions of pontoons - maybe they need to be placed around the mesh such that they form a convex shape. This was because the pontoons I deleted (fixing the problem) were in the middle of the mesh, surrounded left/right/top/bottom by other pontoons. But this is probably also not the cause, because despite these concavity-causing pontoons having been deleted, the issue came back later again (after tweaking center of mass offset - not having touched the pontoons).
Theory 3 - it’s random. Messing with pontoons, adding, deleting, changing position, etc. yields seemingly random switches be a. and b. (described above) buggy behavior.
As of writing this (after messing it up by changing center of mass of the mesh), I was not able to bring the flotation back to a functional state, despite messing with the pontoons some amount.
Long version:
1.
I have successfully made a basic submarine float in ocean.
(I mention this to confirm that I have already overcome all the other issues that would stand in the way of making a thing float - e.g. not having pontoons, not enabling physics, not setting the ocean physics preset to the one necessary for buoyancy (which is not ON by default), etc.)
To confirm - buoyancy was working and my submarine was floating (kinda iffy and slightly nose down, but floating).
I wanted to improve the flotation, so I set about adding more realistically spaced out pontoons (adding sockets to the mesh, and then adding pontoons to blueprint class buoyancy tab, and typing in the socket names).
Having done this, I tested, and was greeted with buggy behavior b. described in TLDR.
I tried removing the pontoons from the middle of the mesh volume (leaving top/bottom/left/right pontoons in place), thus reducing the number of from cca 30 to cca 25.
I tested it, and it suddenly worked again.
I messed with weight and buoyancy coefficient values a bit, to make it sit heavy in the water.
Still floating.
I was still unhappy with the nose of the submarine sitting lower in the water, and I thought that instead of trial&error changing of positions of the pontoons, I will change the center of mass of the submarine mesh to dead center lengthwise and low down heightwise.
Googled how to offset COM, and offset it. NOTE: Didn’t touch the pontoons at all.
Tested, and submarine just fell through the water and sank to the bottom, exhibiting collision physics with the seafloor.
Thought it was because of weight/buoyancy coefficient values, so I messed with those - starting slow, eventually making the mesh absurdly light, and making buoyancy absurdly low. But the submarine still sank, and collided with seafloor.
Having realized this is one of the two different buggy behaviors (described in TLDR) which I encountered while messing with pontoons previously, I went to mess with the pontoons again in effort to fix it with modification of pontoon placement.
The only thing I achieved by adding/deleting and moving pontoons around, and periodically testing, was to randomly alternate between buggy behavior a. and buggy behavior b. - that is, submarine either sinking and colliding with seafloor, or ignoring most pontoons, catching on one, spazzing out, and standing end-on in water.
Summary:
srsl, wtf?
Closing statement:
It is my humble opinion that the buoyancy is plain and simply bugged:
Some number/arrangement of pontoons works fine, another buggs out, alternating between two different buggy behaviors. After offsetting the center of mass of the mesh, even returning to previously working arrangement of pontoons doesn’t work anymore.
How this could have possibly been affected by changing mesh COM is totally beyond me.
PS:
Wanted to include a video, but “Sorry, new users cannot upload attachments.”