Verse Library verse

01 Snippet

Uses a capture zone overlap to automatically toggle a door prop open or closed when players approach.

extracted-snippets/community/snippets/D08/fortnite-verse-automatic-sliding-door/01-snippet.verse

# Source URL: https://dev.epicgames.com/community/snippets/D08/fortnite-verse-automatic-sliding-door
# Local doc:  epic-docs/community/snippets/D08/fortnite-verse-automatic-sliding-door.md
  Start by creating a new verse device named automatic_sliding_door_device and open it is Visual Studio Code, copy and paste the provided verse code and save. Back within UEFN, Ctrl+Shift+B to build verse code.
  Place down a Capture_Area_Device so that it overlaps with your door frame, and set the following options in the details panel:
  Capture Radius 0.5 (this value is the overlap size that triggers our door)
  Untick Visible During Game
  Untick Item Visible in Game
  Untick Consume Item on Scoring
  Untick Consume Item On Scoring
  Untick Display control VFX
  Untick Display ownership change VFX
  Untick Play Sounds Alerts
  Untick Show Objective pulse (all 3 of them)
  Clear the HUD Message
  All of these options basically make the capture zone inert (it doesn't do anything) but it does still have overlap events that we will bind our code to.
  Next, pick a suitable door prop from the available fortnite assets, and drag it into your level. In the details panel, untick Register with Structural Grid.
  You will also need to drag in a Switch_Device.
  Finally, place your automatic_sliding_door_device within your level, location of this device is irrelevant. In the details panel, select your door prop as the door Prop, you can either use the drop-down list, or use the eyedropper (and then just click on your door in the view-port). Do the same to select your capture area, and switch devices. Save all and launch a session, your door should now slide to the right when any player is within your capture zone area. If the door moves in the wrong direction, please take a look at the comments within the below verse code. 

  Expand code  Copy full snippet(20 lines long)
* ```
  using { /Fortnite.com/Devices }
  using { /Verse.org/Simulation }
  using { /UnrealEngine.com/Temporary/SpatialMath }
  using { /UnrealEngine.com/Temporary/Diagnostics }
  
  
  # A Verse-authored creative device that controls a sliding door or gate prop based on players being in proximity (triggered by the otherwise inert capture zone)
  automatic_sliding_door_device := class(creative_device):
      @editable

Sign in free to read the full source 🌴

This Verse Library file is members-only. Create a free account to view the complete source and download the .verse file.

Sign in with Discord

Comments

    Sign in to vote, comment, or suggest an edit. Sign in