Get started
Your first Blueprint
Grow the BP_Counter from Installing Loom into an actor that counts on screen,
one idea at a time. Any Unreal project works, such as a new one from the Third Person template.
-
Run it when the game starts
Section titled “Run it when the game starts”An
onblock is an event: it runs when the engine calls it.ReceiveBeginPlayis Event BeginPlay. Add it, and print the count:Content/Counter/BP_Counter.lm blueprint BP_Counter : Actor at /Game/Counter/BP_Countervar Count: int = 0fn Bump() {Count = Count + 1}on ReceiveBeginPlay {Bump()KismetSystemLibrary.PrintString(string(Count))}Save. Drag
BP_Counterfrom the Content Browser into the level, and press Play.You see1in the top left of the game view. -
Keep counting
Section titled “Keep counting”Call
Bumpevery second with a timer, and move the print into it:Content/Counter/BP_Counter.lm blueprint BP_Counter : Actor at /Game/Counter/BP_Countervar Count: int = 0fn Bump() {Count = Count + 1KismetSystemLibrary.PrintString(string(Count))}on ReceiveBeginPlay {KismetSystemLibrary.K2_SetTimerDelegate(Bump, 1.0, true)}You seeThe count going up once a second. -
Give it a setting
Section titled “Give it a setting”editableshows a variable in the Details panel, where each copy in the level can set its own value. The comment above it becomes its tooltip.Content/Counter/BP_Counter.lm blueprint BP_Counter : Actor at /Game/Counter/BP_Countervar Count: int = 0// Seconds between counts.editable var Every: float = 1.0fn Bump() {Count = Count + 1KismetSystemLibrary.PrintString(string(Count))}on ReceiveBeginPlay {KismetSystemLibrary.K2_SetTimerDelegate(Bump, Every, true)}Select
BP_Counterin the level, set Every to0.25, and press Play.You seeThe count going up four times a second. -
Fix a mistake
Section titled “Fix a mistake”Change
Count + 1toCoutn + 1and save.You seeA notification that the build failed. Its error is in the Message Log, under Loom:no variable Coutn, with the line and column.Fix the name and save again.
-
Use it from another Blueprint
Section titled “Use it from another Blueprint”Every Loom file in the project knows the others. This one nudges the counter every five seconds:
Content/Counter/BP_Nudger.lm blueprint BP_Nudger : Actor at /Game/Counter/BP_Nudgereditable var Counter: BP_Counterfn Nudge() {Counter.Bump()}on ReceiveBeginPlay {KismetSystemLibrary.K2_SetTimerDelegate(Nudge, 5.0, true)}Drag
BP_Nudgerinto the level, set its Counter to theBP_Counterthere, and press Play.You seeAn extra count every five seconds.
What you’ve used
Section titled “What you’ve used”A variable, a function, an event, a timer from the engine, a setting in the Details panel, and one Blueprint using another. Coming from Blueprints gives the Loom for every other node you know.