Learning Unreal as a Unity Developer

Unity & Unreal Logos

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 technical 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 the fact that by default actors have no hierarchy with other actors and instead each actor has it’s own hierarchy of components.

Getting the Editor:

The editor is pretty intuitive and can be learned by just 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 progamming 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 bluerint 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).

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.

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

Continuing your 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:

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 component?

If you still decide you really need to, you have to do it at runtime with AttachActorToComponent

here’s an example from my bowling game of how I attach a ball to a hand socket:

    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)

    // Check is important here because this can fail for a variety of reasons

    check(CurrentBall->AttachToComponent(BallAnchorComp, ballAttachmentRules));

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 (except when 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.

General Resources: