Walking/Jumping On A Moving Ship.

I can’t help with C++ but it is possible in blueprints with a weird technique I found that should have it function right.

  1. Create a Hitbox Mesh and two game objects, the first game object is gonna be the “real boat” or the boat seen by the player, the second boat is gonna be the proxy boat, the boat that the collision and physics will work from.

image

  1. Once this is done, grab on ON Collision function on the “real boat.”

This is gonna be weird cause we are effectively trying to translate the world space to local space to teleport the collision of the player to this proxy boat while everything else is going to be in the real boat.

This code above highlights what would need to be done to teleport the player from the real boat to the fake boat.

I recommend storing the player locally in the blueprint, in multiplayer, make it an array.

Then, teleport every part except the collision of the player to the other real boat.


(Please note, sometimes you might need to make adjustments in the player-noncollission if it does not line up right here, the code in the corner is because this happened with the fake water simulation location for the boat here)

The Proxy boat must share the same Rotation as the real boat in this case else it will not truly work.

Lastly, a reset of the player mesh location and actor location must be done after the player collision leaves the proxy boat. Here is my code, I am not gonna mark it up:

Here is the result of the code:

2 Likes