First Person Exploration Kit: Creating a Basic Player Dock


Dock Objects

Dock interactions allow for the player to "dock" at a location such as a computer terminal, chair, or arcade machine. Along with a locked position, the player will also have a restricted view. For example, if creating a computer terminal, the player will not be able to move while docked, and they can have a view that is restricted to only allow them to look at the computer screen and keyboard.

There are two example docks included in the package: A simple chair that the player can simply sit it, and a complex arcade machine mini game that you can play.

Here are the steps required to make a simple dock:

  1. Create an empty Game Object, rename it "MyDock"
  2. Add a Box Collider or other primitive collider. This will be the "Interactable" zone that the player must look at and interact with to dock onto the object.
  3. Add the FPEInteractableDockScript component.
  4. Add an empty child Game Object, rename it "SeatPosition".
  5. Add another empty child Game Object, rename it "FocalPoint".
  6. Click on "MyDock" parent object, and assign "SeatPosition" into the "My Dock Transform" field, and "FocalPoint" into the "My Focus Transform" field.
  7. You will notice that two new gizmos will be drawn, one for each of the newly assigned child transforms:

  8. Move the two child transforms so that the purple "SeatPosition" transform corresponds to the player docked location, and the green "FocalPoint" corresponds to where you want the player's focus to be when docked.

  9. Note: The transform assigned to "My Dock Transform" (in this example, "SeatPosition") will align to the player's center point. So, you probably want it to be a little higher than where the player might logically sit down.

  10. Adjust the rest of the "Dock Specific Values" Inspector fields:
  11. Run the scene, and interact with the new MyDock object.
  12. Adjust relative positions of the "SeatPosition" and "FocalPoint" transforms as well as Dock View Limits until it feels correct.
  13. Add other meshes or objects around the dock as required to round out the interaction for your specific needs (e.g. a computer desk, chair, keyboard, instruction sheet, etc., etc.)
  14. Below is a screenshot of our completed sample dock with an comfy chair model.


    And here is the player's view while seated in the completed "chair" dock.



Note: By default, Dock states are saved and loaded at a basic level. For example, if the player was sitting in a chair when they saved their game, they will still be sitting in the chair when they load their game. Saving additional context or data related to other interactable objects the player might use while docked is up to you. For example, if you have a computer terminal that the player uses while docked, and you want to save the computer terminal state as part of the saved game, you will need to implement that yourself. Please refer to the Save/Load System documentation and included demo prefabs for more details.