Devices are assets that do things. Different devices do different things, but they all do something. Some devices wait for player interaction to do something, while other devices do something when they're triggered by another device.
Devices, along with other devices and player actions, are what create gameplay.
In this tutorial, using devices, you will set up the game so that the player receives a weapon when spawning onto the island. The player will use that weapon to shoot at the targets. When the player hits a target, their score will change. This is a basic gameplay loop, which is a key element of game design.
Devices Used
1 x Item Granter device
Place the Item Granter
You already have the Player Spawner device on your island. To give the player a weapon when they spawn, you will use an Item Granter device.
If the Content Browser is not already open, go to the menu bar at the top, click Window > Content Browser, then select the Content Browser 1 panel.
This opens the Content Browser.
If you close the Content Browser, when you open it again, it will restore to exactly how it was when you closed it.
An asset is any element you use to build a game. The Content Browser is where you can find all of the assets associated with or available to your project.
In the Content Browser, click Fortnite. This shows the different asset folders.
Click the Devices folder and scroll down until you find the Item Granter device, or use the search bar to quickly search for item granter.
Drag the Item Granter device into the viewport.
Customize the Item Granter
All devices have default settings that determine what they do, but you can customize most devices to create your own gameplay. Rather than customizing the actual device, you are going to customize an instance of the device.
Think of an instance as a unique copy of your asset. The original asset determines the default properties for that asset (in this case, the Item Granter device), but you can customize the new instance without affecting the original asset.
Open the Details panel if it's not already open (Window > Details > Detail 1).
Click the Item Granter device in the viewport to select it and you'll see the device in the Details panel.
Highlight Item Granter (Instance), then set the following User Options:
On Grant Action = Keep All
Grant = All Items
Without collapsing User Options, expand Advanced, then customize these settings:
Grant on Cycle = Uncheck
Equip Granted Item = Check
Item Count = Check, then 1
Add a Weapon and Ammo
To provide a weapon for the player, you will need to register the weapon with the granter. Registering is how you associate a weapon (or any other item) with the Item Granter device.
On the Item Granter (Instance) Details panel, look under User Options and find Item List.
An array is a collection of items or data. Click the + icon next to Array, then click the dropdown for Index [0].
This opens more options.
Click the dropdown shown below.
This opens another window where you can search for a specific item or a type of item.
Type assault rifle in the search bar, then select from the list of weapons.
To search for a specific weapon, you can use the weapon name. Select an assault rifle from the list. This adds the rifle to the Array list for the Item Granter device.
The Item Quantity is 1 by default. The granter will grant one assault rifle to the player.
Click the + icon next to Item List to add another item.
Type ammo in the search bar. This surfaces all the ammo types in the search list.
Assault rifles use medium bullets. Search for and select the AmmoMediumBullets from the list.
The next step is to get the Player Spawner and Item Granter devices working together.
Bind the Item Granter and Player Spawner
Devices communicate using Functions, which are things devices do, and Events, which are things that trigger functions.
Unlike in Fortnite Creative, where you can bind from a function to an event or from an event to a function, in UEFN, you can only bind from a function to an event.
From the Item Granter (Instance) in the Details panel, go to User Options - Functions and expand it.
Scroll down to Grant Item, click the + icon, then click the dropdown. Grant Item is the function you'll bind from.
Search for or scroll down to Player 1 Spawn Pad and click it to select. This is the device you'll bind the Item Granter to.
Click the dropdown, then select On Player Spawned. This is the event you're binding to the Grant Item function.
Players spawning onto the island now spawn with the assigned assault rifle and ammo!
If you ever have difficulties finding the settings you're looking for, click the edge of the Details panel and drag it to make it wider.
Move Objects
You can move an asset, also known as an object, using one of the Move tools.
The pivot point controls how an object rotates and scales. Any change of size or orientation is relative to the object's pivot point. The pivot point is at the bottom of any object that is included with or native to UEFN. The QWER keys are the keyboard equivalents to clicking the icons.
1. Select objects (Q) | Selects an object and highlights it. | |
2. Select and translate objects (W) | Makes it translatable (movable) using the translate arrows. | |
3. Select and rotate objects (E) | Makes it rotatable in three dimensions. | |
4. Select and scale objects (R) | Makes it scalable in three dimensions. |
The other key component of moving objects is the axis. Axes are directions in three dimensions. These axes are in relation to the pivot point, and are referred to as X-axis, or up, Y-axis, or left, and Z-axis, or forward.