Components are basic building blocks that use data and logic when you're building your game. Use the lightsaber_item_component and the kyber_crystal_component to:
Choose the appearance of the hilt of your lightsaber.
Customize the color of the blade, its stability, and the intensity of any energy arcs along the blade.
For how to add a component to your entity, see Working with Entities and Components
Class Description
You can configure Lightsabers in UEFN in Scene Graph or use premade lightsaber items.
The Scene Graph components involved in configuring lightsabers include:
The
lightsaber_item_component- Responsible for the hilt of the lightsaber. Inherits fromitem_component.The
kyber_crystal_component- Responsible for the color of a lightsaber, the stability of the blade and any visible arcing of energy along the blade. Like a real lightsaber, change out the kyber crystal if you want a different color!
You can choose from a variety of premade lore-inspired lightsabers, with each reflecting different eras and characters from the Star Wars™ universe.
You can find these premade lightsabers in Unreal Editor for Fortnite (UEFN). Open the Content Drawer and navigate to All > Star Wars™ Content > Weapons.
For more information on premade Star Wars assets available to you in the editor, see Working With STAR WARS™ Islands.
The lightsaber_item_component inherits from the item_component, sharing many of its properties. This means that any lightsaber entity is an item in the same way an entity with the standard item_component would be. This enables adding lightsabers to an inventory, lightsabers being manipulated by inventory components, and equipped by the player like any other item.
For more information about items, see Item Component.
For more information about inventories, see Inventory Component.
Example
You can use Verse to grant custom lightsabers to players when they complete a task or action. The following example is a lightsaber spawner device that uses Verse to grant the player a lightsaber with an attached Force power when a specified button device is pressed.
using { /Fortnite.com/Devices }
using { /Fortnite.com/Items/Lightsaber/StarWars }
using { /Fortnite.com/StarWars }
using { /Verse.org/SceneGraph }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Itemization }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /Fortnite.com/UI }
using { /UnrealEngine.com/Temporary/UI }
using { /Fortnite.com/Items/ForcePower/StarWars }