In Learn the Basics of Writing Code in Verse, you learned how to create variables and functions. Now that you have some familiarity with the basics of writing code in Verse, let’s look at using Verse to create and work with a device in Unreal Editor for Fortnite (UEFN).
Creating a New Device with Verse
Follow these steps to create a Verse-authored device in UEFN:
- Open your project in UEFN, then in the Menu Bar, go to Verse > Verse Explorer.
-
In Verse Explorer, right-click on your project name and choose Add new Verse file to project to open the Create Verse Script window.
-
In the Create Verse Script window, click Verse Device to select as your template.
-
Name your device by changing the text in the Device Name field to the name of your device. In this example, the device is named my_first_device.
-
Click Create to create the Verse file.
- In Verse Explorer, double-click the name of your Verse file to open it in Visual Studio Code and edit it.
Adding Your Verse Device to Your Level
Follow these steps to add your Verse device to your level and run your code:
-
Before you can drag your Verse device into the level, you have to compile your code. In the Menu Bar, go to Verse > Build Verse Code.
-
Your device will appear in the CreativeDevices folder. This example the device is named my_first_device.
-
Drag your device into the level to run its code when you playtest.
-
In the toolbar, click Launch Session to playtest your project and save when prompted. This opens your Fortnite client. Click Start Game from the Main Menu to run your code.
Next Steps
Now that you've created a device using Verse and added it to your level, follow these guides to learn how to add functionality to your device:
Tutorials
For examples of how to use a Verse-authored device to build games, explore these guides: