How would you make a boat movement system, like in sea of thieves, where the player can freely walk around the boat, while it’s moving?
My attempts so far hasn’t quite been working.
Many thanks in advance.
How would you make a boat movement system, like in sea of thieves, where the player can freely walk around the boat, while it’s moving?
My attempts so far hasn’t quite been working.
Many thanks in advance.
The character movement component should work on moving objects by default. What happens when your ship moves? If it’s just the jumps acting strange, check to see if the various impart velocity settings on the character movement comp are true. If the problem is walking up stairs on the ship as it tilts, maybe up the walkable floor angle or step height? Also double check that the collision on ship has “can character step up on” set.
Getting AI to walk around on a boat is a whole different beast though. IIRC, the Sea of Thieves devs made static versions of ships, hid them under the sea floor somewhere, and made proxy AI walk around on the dummy ships and translated the movement back to the regular actors. Probably quite bit of c++ going on there.
The ship moves fine, the issue I’m facing is if the player jumps, or isn’t grounded, their velocity seems to be reset, so the ship is moving on, without them.
I was hoping there might be a setting in unreal I’ve overlooked, maybe about imparts(?) that solve this easily
In the character movement component, there should be check boxes under jumping/falling for “impart base velocity” x, y,z, and angular. Ticking those adds a platform’s movement to the character when they jump or fall off. It can be a bit touchy when the base object is making tight turns, so you might also want to play with the “braking deceleration falling” and air control values there.
All of those are checked, but the issue is still there.
I made the boat as a pawn, to use the movement methods, from pawn, to move the boat forward and such, using the floating pawn movement component, I don’t know if that could be part of the issue?
How are you adding the movement input to the pawn? Is it following a spline with a timeline or something? Or directed by a controller using pathfinding?
Floating pawn movement itself should be fine. Riding around on a large cube pawn worked for me at least.
I’m using the add movement input node
How are you getting the vector for the add movement input node though? Is it coming from a spline, or is boat being steered by AI or the player somehow?
It’s the forward vector
Not sure what the problem might be. Only other thing I can think of right off hand is to maybe check the actor tick settings at the top of the pawn details panel and make sure the tick group is set to Pre Physics. This probably shouldn’t matter since the move input should apply to physics either way, but since your character has impart velocity turned on, something might be causing it to not be passed through.
Thank you very much for the help though
Just lurking… But FWIW here’s a few quick observations before off for some tasty IPA. Highly recommend watching all the RARE GDC vids on SOT as they’re amazing. Done a fair bit of tweaking this kind of platform / player movement gameplay before, and often its a PITA when it should be so simple. As you can often find yourself fighting the CMC, especially in multiplayer.
Anyway irrelevant of whatever CMC settings you tick, and irrelevant of whatever powers the platform (physics / kinematic), you’ll still need to manually add some kind of platform / player momentum imo. So while the impart velocity / impulse options seem like a nice idea, most of the time they never quite work out, or are never really that all reliable (just my experience).
So maybe try to work out the momentum required, and then factor that into a Launch / Add Force node or something similar (sample code for tether systems may also be useful to look at here). If so, skip using Launch. But overall tbh mostly ended up disabling jumping on moving platforms (ships). As there always seems to be a bunch of edge cases where it still fails.
Overall, this kind of thing could use a proper Marketplace plugin solution. Especially with Epic changing physics engines and breaking things across different engine versions. You may get something working today. But then when there’s another version it stops. Just my 2c… YMMV
Thank you!