Download

Character interactions with objects like in Sea of Thieves

Hello,

I would like to accomplish character interactions with objects (Ladders, Levers, Anchors etc.) like in Sea of Thieves.
While the Character is interacting with an object his movement is changed / limited to specified inputs which then actually controlling the object.
Video example of Sea of Thieves Interactions: https://www.youtube.com/watch?v=HTiqzADhw8I

What would be the right way to achieve something like this?

Personally as a first prototype I would work already with states and using those from the perspective of player controls and state of object, just as the sail.

The best I can suggest you if it helps to look into ENUMS in Blueprint to avoid even in the prototype a boolean workflow: https://wiki.unrealengine.com/Bluepr…Enum_Variables

With the controls I would look into Character Movement Component (In the Player Character) and Player Controller to drive input and movement.

I am not quite sure if this exactly helps since I don´t know your level but if you´d like I can at least go over one concept here, like the sails mechanic.

Hello Martin, I would love to see an example about something like that. I’m pretty new to blueprint scripting and have no knowledge about C++.

Also I think that I should mention that this Project is planned as a Mulitplayer only game.

Best Regards
Martin :slight_smile:

Edit:
Here is my current progress:

It does not really feel editable at all, for example: If I would like to add a simple Ladder and it should also be “usable” with the same Key (e) - I actually wouldn’t know how to expand the current Blueprint on other objects or tasks. Another example would be a Weapon pickup from the ground with the same Key.
I don’t know which way I should go for something like this.

Some Screenshots and a small Video:

Inside Character Blueprint:

Inside Actor Blueprint (Lever)

Small Video:

Best Regards
Martin

Hey

I can help you over Discord as I already see some aspects where your system scales easier.

Though here a couple of things.

  1. I know that you use the LineTrace to get awareness of you´r intractable actor - but I would put awareness into another function by letting the Player check constantly and save the HitResult away. (For instance Event Tick or a Timer) Of course you can filter through a base class or if as you do an interface.

  2. You already have an interface implemented which you are using, at the same time you are accessing the function “Bruecke Runter”. Make it part of your Event On Interact by rotating the object at the time you rotate the lever. (or differently if your mechanic so desires) Your bridge can already be part of your lever in design time, by having an actor variable of type “brigde” and manually add it by exposing the variable, so you can use it in the editor.

  3. If the player is in the state of interacting with your lever, tell your Character Blueprint through an ENUM for instance that it is in that state (interacting for instance), and in your Character Blueprint, create a flow for InputAxis MoveForward, that it sends the AxisValue to the On Interacted. Also use the ENUM in the “Interaction Use” flow, so it can´t trigger anything anymore. (More elegant would it be if you could use your interaction Use instead of the MoveForward)

  4. The ENUM state can then also used to stop movement from the player but Input intaction on the player.

Overall it allows you the following:

  • Any object drives through OnInteracted its behavior
  • The Player or Character Blueprint is aware of its state, either interacting with an object or in a normal movement state.

Meaning, any object can do what ever it wants when interacted and the Player will be always in the appropriate state when interacting.

Hope that helps as an orientation. Again I am happy to help over discord and since you have a function “Bruecke Runter” I guess we can do that in german then ;). My user name is
neryun#6354

Hi Martin

Thanks for your quick Reply. I will try to follow your described Path and will contact you via Discord after I made some progress. Will be a way easier to discuss this in german :slight_smile:

No problem I’ll be though this week on the road so I might be only to help through chat. I am back Saturday.