What are the UE4 equivalents to Unity3D concepts?

I’m fairly familiar with Unity, and I’m having some trouble translating my conceptual understanding over to unreal.

Can someone who is familiar with both help with a basic primer?

My understanding so far, and please correct me if I’m wrong, is: (and I’m aware that there is no exact one-on-one mapping)

GameObjectActor

prefabBlueprint

However, custom code can both be a “GameObject” as well as be a component for a GameObject, unlike unity. When is the right time to subclass an actor, and when is the right time to subclass a component?

Can someone help me finish the rest of this?

I’m not a unity user so I can only comment on the UE part.

Generally speaking everything in UE is an object, including both the Actor and Component instances. Now component is light-weight objects that accomplish a very specific need, and you can add as many of them as you need to your actors, to give your actor more functionality when needed.

But as for your last question, since you’re just starting out with the UE, you almost always are only going to extend from Actor, or one of it’s children, like Pawn, Controller, etc., and you’re not going to need the component as a parent class, at least not for a good while, so for now just stick to the components that are provided, and construct your custom actors using them.

https://docs.unrealengine.com/latest/INT/Search/index.html?x=0&y=0&q=unity+unreal

enjoy

That is a very interesting question! In general I would say subclass Actor etc when the code you are writing wants to make use of a set of other components. This is one of the nice things about subclassing an Actor and adding code, you know the set of Components that you are dealing with. If the code you are writing doesn’t depend on other components, and is quite self contained, you could probably write it as its own component so it could be used on lots of different Actors. The fact that you have the choice gives you a lot of power and flexibility in Unreal, but also means you have to think about the best place to put things. I would say most of our game code is written inside Actor/Pawn/Controller etc derived classes.

Thanks, that helps to get my mind around it.

In Unity, since everything is a component, you often need to write code to allow one component to find another. Since in unreal I can add code to the actor itself, that seems really helpful to write the code that connects components together.

So: Code that adds specific behavior, that might be useful in multiple objects: Component. Code that glues components together, or is specific to only one object: Actor.