Is a Blueprint equivalent to a Prefab in Unity?
I don't know if anyone else has already asked this question after doing a quick search. If yes, then this is a duplicate question.
Is a blueprint in Unreal Engine 4 equivalent to a prefab in Unity? If not, what is the proper term for a sort of Actor in Unreal Engine 4 where you can instantiate multiple instances of it and change properties on specific instances?
I'm new to Unreal Engine 4, but I used Unity before. To me, blueprints are like recipes, where you can make the same thing multiple times and it still has the same properties as the original recipe. It's the same idea with a prefab in Unity.
asked May 01 '19 at 10:25 PM in Blueprint Scripting
No, Unity and UE4 actors are conceptually different
Unity has unified empty (without any interactive code) Object container which you place on level and equip with components which adds code to it. Those object can be snapshoted and saved in to prefabs and replaced, but when you technically don't place prefab, but Unity reconstructs the object to state from saved prefab data
UE4 regardless of also having components which work in similar fashion of its counterparts in Unity, is more class based and more object oriented. Every class is a inherent from UObject class and everything you place on level ins inherent to AActor class (which is also UObject). When you create C++ class or Blueprint you extending already existing class, your actor by that is already equiped with code (in C++) and it reason why blueprint can function without any nodes and component placed, this is fundamentally different then what Unity objects functions which relays soly on components. And when you place actor on the level, it is not empty reconstructed empty shell, but spawned object created from class.
So beyond Actor class you have entire pack of different actor classes (and UObjects too) which have premade roles and sometimes massive ready code, like APawn which is actor that can be possessed and controlled by APlayerController which represents player in world (there UPlayer but it role is less impotent), ACharacter that extend from APawn to support more humanoid characters and there movement, AGameMode which controls entire game match and yes its a actor too. All of classes have set of events and overridable functions, allowing to alter behavior of already existing code. You can read more about different classes here:
You also got lot of dummy actor classes which contain just a single component, as physicality of objects are controlled by them and only actors can be placed on the level. But you also have actors class that are fully functional like ADefaultPawn which is spectator cam and used when you dont have any other pawn on the level. You can see entire class tree in Class Viewer (Window->Development Tools->Class Viewer).
As said before Blueprint is fully valid class same as you would do C++ class, it appers in class tree and you can make blueprints based of other blueprints. When you make blueprint you presented with most important classes you can pick to inherent, but below you have option to pick any class from the tree (that been marked as blueprintable in C++.... and all blueprints, in fact blueprint asset have option to create inherent blueprint from right click). You can for example pick ADefaultPawn, blueprint you made will work like that class without any nodes and from that you can create extended spectator cam.
You can made base class in C++ or blueprint for all of your actors containing common code, which on change will impact all actor classes that been extended from it, allowing you to create entire sets of actors that interact same way.
In past i made video about object and class in UE4, should show you those concepts in practice:
That said, UE4 has ability to construct actors on the level same as Unity (which changes are stored on the level), by editing there properties and adding and edit actor components, yet it does not have ability to snapshot like in Unity them which would be useful. Because of that somebody made plugin called Prefabricator, which allows you to save in level editor constructs like in Unity:
Ofcorse it does not change fundamentals that UE4 work in, when you place prefabricated object it place the actor of class that been saved and the reconstruct it to the state it was saved, so it kind of hybrid solution of two worlds
Follow this question
Once you sign in you will be able to subscribe for any updates here