Download

Newbie Basic C++ Project Questions

I’m trying to understand and learn as much as possible just by looking at the basic C++ project. Could you help?
Let’s take the ‘PlayerStart’ in the world:

  1. It has several members like ‘Rendering’, ‘Input’, 'Actor’etc. R-clicking > ‘Open PlayerStart.h’ reveals none of these members. Where can I see them?

  2. ‘Add Component’ button adds “sub-components” to actors, each having its own “members”.
    Am I correct to call such a sub-component - “USceneComponent” and its “members” - *UActorComponent *'s?

  3. I noticed I could move not only in viewport but ingame too. Where is the input located for moving in the world? I couldn’t find it. ‘PlayerStart’ has an actor component as ‘Input’ but it only has ‘AutoReceiveInput’ = ‘Disabled’ and ‘InputPriority’ = 0.
    ‘C++ Classes’ in Content Browser has only a GameModeBase that doesn’t have anything related to input either.

Everything in game world, 3D space, is child of many other children of UObject;
The least class which has a 3D transform (thus can be placed in 3D space) is a USceneComponent.

You can see class hierarchies here: https://docs.unrealengine.com/latest/INT/API/Runtime/CoreUObject/UObject/UObject/UObjectHierarchy/index.html

Thank you. I’m pretty excited to have received a reply from an actual Unreal Contributor! All my sincere admiration for this unparalleled Engine (switched from Unity which I’ve been working with for 2 years…).
I haven’t coded a single line in Unreal Engine just yet but I’ve been reading documentation and watching tutorials for about 3 weeks to prepare myself.
About the link you provided - I’ve already read and I know that everything inherits from UObject. I also know that *USceneComponent *inherits from UActorComponent, having in addition a transform. And that’s exactly what made me ask question 2 - I still can’t relate the classes in that framework hierarchy to Unreal editor UI ‘Details’ panel structure.

Every component is child of the Actor, there is no “sub component”.
What you mean is the transform hierarchy, you can attach component’s transform to other transforms, but the component object itself is still attached to the owner Actor only.

For players, control inputs are handled by a PlayerController class;
APlayerController is an Actor spawned at runtime by your GameMode class which is used to control whatever “possessed pawn” or “possessed character” class you have.

The “Strategy Game” in launcher’s learn tab make good example of how to use these many classes together to build your GameMode class through code.

Thank you. So “component” means child of - as in object attached in the transform hierarchy.
And it’s guaranteed to derive from USceneComponent (or even just USceneComponent), right?
And members of an AActor (i.e. those appearing in “Details”) are guaranteed to be *UActorComponent *or derived, right?