Skip to content
forked from Tencent/UnLua

A feature-rich, easy-learning and highly optimized Lua scripting plugin for UE.

License

Notifications You must be signed in to change notification settings

outsider31000/UnLua

 
 

Repository files navigation

UnLua

LOGO

license release PRs Welcome

Overview

UnLua is a highly optimized Lua scripting solution for Unreal Engine (UE). It follows UE's programming paradigm, is feature-rich, and easy to learn, enabling UE developers to use it with zero learning curve.


Using Lua in UE

  • Directly access all UCLASS, UPROPERTY, UFUNCTION, USTRUCT, and UENUM without glue code.
  • Replace implementations defined in Blueprints (Event / Function).
  • Handle various event notifications (Replication / Animation / Input).

For more detailed functionality, check the Feature List.


Optimized Features

  • UFUNCTION Calls: Includes persistent parameter caching, optimized parameter passing, and improved handling of non-const references and return values.
  • Access Container Classes: (TArray, TSet, TMap), memory layout matches the engine, with no need for conversion between Lua tables and containers.
  • Efficient Struct Handling: Creation, access, and garbage collection (GC).
  • Support for Custom Static Export: Includes classes, member variables, member functions, global functions, and enums.

Platform Support

  • Runtime Platforms: Windows / Android / iOS / Linux / macOS
  • Engine Versions: Unreal Engine 4.17.x - Unreal Engine 5.x

Note: Versions 4.17.x and 4.18.x require modifications to Build.cs.


Quick Start

Installation

  1. Copy the Plugins directory to the root directory of your UE project.
  2. Restart your UE project.

Start Your UnLua Journey

Note: If you are new to UE, it is recommended to follow the more detailed Quickstart Guide for UE Newbies to continue with the following steps.

  1. Create and open a Blueprint. In the UnLua toolbar, select Bind (you can also hold Alt to automatically generate the path in step 2).
  2. In the GetModule function of the interface, enter the Lua file path, e.g., GameModes.BP_MyGameMode.
  3. Select Create Lua Template File in the UnLua toolbar.
  4. Open Content/Script/GameModes/BP_MyGameMode.lua and write your code.

More Examples


Best Practice Example

Lyra with UnLua: A complete example project based on the official UE Lyra Starter Game Package (currently under development).


Documentation

Detailed Documentation:


Technical Support

  • Official QQ Group: 936285107
  • Recommended VSCode Plugin: Lua Booster

About

A feature-rich, easy-learning and highly optimized Lua scripting plugin for UE.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 72.8%
  • Lua 21.8%
  • C 3.9%
  • C# 1.4%
  • TypeScript 0.1%