Question: Can You Use C# in Unreal Engine?

Answer

No, Unreal Engine does not natively support C#. Unreal Engine's primary programming language is C++, and it also supports visual scripting through Blueprints. C++ is used for high-performance code, and Blueprints are used for quickly iterating gameplay features without the need for compiling.

However, there is a community-driven project called UnrealCLR that aims to integrate C# into Unreal Engine as a third-party plugin. UnrealCLR acts as a bridge between the managed environment of .NET and the native environment of Unreal Engine. Here's a basic example of how one might use C# with a plugin like UnrealCLR:

using UnrealEngine.Framework; namespace HelloWorld { public class Game : ManagedEntryPoint { public override void OnWorldBegin() { Log.WriteLine("Hello, World!"); } } }

Keep in mind that using plugins like UnrealCLR may come with limitations compared to the full native capabilities of C++ within Unreal Engine, and such solutions may not be officially supported or fully compatible with all of Unreal Engine's features or future updates. For official game development and full use of Unreal Engine's capabilities, learning C++ and Blueprint scripting is recommended.

Was this content helpful?

White Paper

Free System Design on AWS E-Book

Download this early release of O'Reilly's latest cloud infrastructure e-book: System Design on AWS.

Free System Design on AWS E-Book
Start building today

Dragonfly is fully compatible with the Redis ecosystem and requires no code changes to implement.