Learning Unreal as a Unity Developer

Over the last year, I’ve been learning Unreal in my free time and having an absolute blast. Since then, multiple friends have asked me for resources I’ve found helpful during the process, so I’m collecting them here along with some tips I wish I would have had starting out.

Just a quick note that this information will mostly be from a programmers perspective as that’s my background, if you are just learning how to program and/or not familiar with Unity, these might not be the right resources for you.

Getting Started:

To get the lay of the land, you should start with Alex Forsythes incredible video:

Unreal vs. Unity: Actors & Components, Inheritance & Composition:

This will give a good overview of the game object model unreal uses. It’s similar to Unity’s but different in subtle ways like:

And so much more!

Using the Editor:

The editor is pretty intuitive and can be learned just by playing around with it, but it’s worth it to check out Unreal’s documentation for Unity devs to ramp up faster.

OK, but how do I start writing code?

Blueprints and C++ are the core of Unreal’s programming model and you should use them both.

Watch this first to understand when one works better than the other:

Blueprints vs. C++: How They Fit Together and Why You Should Use Both:

One especially important thing to note is that whatever mixture you choose, DO NOT CALL BLUEPRINT FUNCTIONS DIRECTLY FROM C++ (Use a base method in C++ that the blueprint implements).

Blueprints

Blueprints are a good place to start playing around with Unreal. I was personally not a believer in them at first, but when you combine them with C++, they are very powerful. I find them most useful for long-running chains of events, quick visual effects, and prototyping.

Unreal’s documentation here is solid so check it out:

Blueprint Programming Quickstart Blueprint Programming Overview

C++

C++ can be intimidating at first, but Unreal provides free garbage collection and lots of macros/libraries/etc that will make you feel right at home as a Unity/C# developer. I recommend using Rider as it will help you avoid the many, many footguns that exist in C++ (Yes the license costs money, but it’s worth the $15 a month) (Rider is now free for non-commercial use!).

I’ve never used C++ before

Oh you sweet summer child, I’m here to help. C++ does a lot of things differently from other languages and it’s important to at least understand the basics before jumping in.

Tom Looman’s C++ Guide is probably the best place to start if you’re brand new to C++. Pay special attention to the pointers section, they are the key to understanding how C++ works.

If you know Java (or C#), you can also get started pretty quickly with Patricia Aas’s talk (though some of her advice is more safety-oriented than Unreal is)

Patricia Aas - C++ for Java Developers

I did some C++ in college and kinda remember the basics

Laura’s Unreal blog will probably get you up to speed more quickly:

Unreal C++ Speedrun

Main things to know with Unreal C++

Continuing your C++ journey

At this point you know just enough to be dangerous, so get out there and start making something!

If you really want to dig deeper into C++, here are a few resources I would recommend:

Structuring your Gameplay code

Unreal comes with a lot more structure than you might be used to coming from Unity. I’ll attempt to highlight the pieces I find most critical/useful here:

What do I do instead of using Prefabs???

You should think of blueprint subclasses as your analogue to prefabs. In-fact, if you want a setup that is as close to Unity’s prefab workflow you can get that and here’s how:

  1. Make C++ base class
  2. Create a Blueprint class that inherits from that base class
  3. (For variants) Create new Blueprint classes that inherit from that

That’s it, you can extend those classes even further for different variants, but from here you can just drop those actors in the scene or set them as properties.

Some Common Gotchas/Tips:

Extra Credit:

This gives good overview of the lifecycles that exist within Unreal and how everything fits together.

The Unreal Engine Game Framework: From int main() to BeginPlay:

Multiplayer is one of Unreal’s best features, so if you’re interested, try learning more about it. Property replication is your go-to tool when making multiplayer things.

Unreal vs. Unity: Actors & Components, Inheritance & Composition:

Misc things:

But I really need to nest actors under other actors like in Unity:

First think about if you really need to, is this functionality better as a reusable component?

If you still decide you really need to, you should do it at runtime by spawning the actor and using AttachActorToComponent. This allows you

Here’s an example of how you would do that:

// In Blueprint, you would use Spawn Actor From Class instead

const ABall* CurrentBall = GetWorld()->SpawnActor<ABall>(ABall::StaticClass, SpawnTransform);

const FAttachmentTransformRules BallAttachmentRules(
    EAttachmentRule::KeepRelative, //  Match Parent Location

    EAttachmentRule::KeepRelative, // Match Parent Rotation,

    EAttachmentRule::KeepWorld,    // Maintain Current Scale

    false);                        // Don't Weld Bodies (not usually relevant)

bool attachSuccessful = CurrentBall->AttachToComponent(BallAnchorComp,
                                                      BallAttachmentRules);
// It's important to make sure this succeeded as it will sometimes silently fail

check(attachSuccessful);

Alternatively, if this is for cosment

FOV Scaling:

Unreal and Unity use opposite FOV Scaling (Unity keeps it consistent as you stretch horizontally), you can change this to be more consistent with Unity by going to Config/DefaultEngine.ini and adding the following snippet to the end of it:

[/script/engine.localplayer]
AspectRatioAxisConstraint=AspectRatio_MaintainYFOV

Alternatives to common Unity Assets/Libraries:

My compile times are slow, what do I do?

Usually the advice for improving compile times goes:

  1. Use Forward Declarations in your header files instead of includes wherever possible (and generally remove un-used includes)
  2. Make sure Unreal and your IDE are both installed on an SSD
  3. Use Live Coding to avoid doing full recompiles wherever possible (Note: you still have to restart after editing header files)
  4. Upgrade your computer with a faster CPU or more RAM

My in-game loading times are slow, what do I do?

9 times out of 10, this is because you’re loading too many assets at once.

Look at your Asset Dependency Chain, then convert things to Soft References that aren’t needed all the time.

Other helpful Unreal resources: