Your First Script
This is the moment it gets real. You're about to write code that runs inside a multiplayer World. Let's start with the classics — print a message, then spawn something.
Create a Package
Scripts live inside Packages. Let's make one:
- Open HELIX Studio from the Launcher
- Go to File → New Package
- Name it
my-first-package - Choose Script Package as the type
- Hit Create
Your Package folder is now set up with the right structure, and a starter script file is waiting for you.
Hello HELIX!
Open the main script file in your Package. Let's make sure everything works:
- Blueprint
- Lua
- JavaScript
// In your Blueprint Event Graph, add a Print String node
// connected to Event BeginPlay:
// Event BeginPlay → Print String ("Hello HELIX!")
// This prints to the screen and output log when the Package loads.
In HELIX Studio, open your Package Blueprint, find Event BeginPlay, and wire it to a Print String node with the message Hello HELIX!.
-- my-first-package/Server/Index.lua
print("Hello HELIX!")
// my-first-package/Server/Index.js
console.log("Hello HELIX!");
Run your World with the Package loaded. You should see "Hello HELIX!" in the output log. If you do — congratulations, you're a HELIX scripter now.
Spawn an Actor
Printing is great for debugging, but let's do something visible. Here's how to spawn a prop in the World when the script loads:
- Blueprint
- Lua
- JavaScript
// In your Blueprint Event Graph:
//
// Event BeginPlay
// → Spawn Actor from Class
// Class: StaticMeshActor
// Spawn Transform: (Location: X=0, Y=0, Z=200)
// → Set Static Mesh (mesh: /Engine/BasicShapes/Cube)
//
// This spawns a cube 200 units above the origin.
Drag out from Event BeginPlay, add a Spawn Actor from Class node, set the class to StaticMeshActor, and configure the spawn transform. Then set its mesh to a basic cube.
-- my-first-package/Server/Index.lua
-- Spawn a cube prop 200 units above the origin
local myProp = Prop(
Vector(0, 0, 200), -- location
Rotator(0, 0, 0), -- rotation
"helix::SM_Cube" -- static mesh asset
)
print("Spawned a cube at: " .. tostring(myProp:GetLocation()))
// my-first-package/Server/Index.js
// Spawn a cube prop 200 units above the origin
const myProp = new Prop(
new Vector(0, 0, 200), // location
new Rotator(0, 0, 0), // rotation
"helix::SM_Cube" // static mesh asset
);
console.log(`Spawned a cube at: ${myProp.GetLocation()}`);
Run the World again. You should see a cube hovering above the ground. It's not much to look at — but it was conjured into existence by your code, in a multiplayer World, running on Unreal Engine 5.
What happened here?
- You created a Package to hold your scripts
- You wrote a server-side script that runs when the Package loads
- You spawned an Actor (a physical object in the World)
Server-side scripts run on the server and control the authoritative game state. Later you'll learn about client-side scripts for UI, effects, and input handling. But the server is where the real game logic lives.
What's next?
You've got a World with objects and scripts. Now let's publish it so other people can see what you've built.