Does the game engine call GetMovementComponent() and how can I find out what functions the game engine calls? I have looked through the documentation and I must be missing it somehow.
I’m afraid you’ll have to be a bit more specific. At some point and somewhere during execution the game engine will call GetMovementComponent(), of course. Are you looking for a specific location, reason, or purpose?
As for your second query, yes and no… Personally I have not found a document for UE4 that goes over from the start to finish the sequence and order the engine calls… however their does exist an ancient text from the days of UDK (Unreal Engine 3). The UDK document “mostly” still applies…
Other than that I have spelunked through the code and identified various function calls that indicate a sort of order of events. It would actually be really nice to have such a document.
Generally you need to look at a few classes.
AActor
- BeginPlay()
- Tick(deltaTime:float)
- PreReplication()
- EndPlay()
UActorComponent()
- BeginPlay()
- InitializeComponent()
- TickComponent()
- EndPlay()
The following are all Actors but should be reviewed in brief as they perform various actions during startup. Generally all Actors Follow the same Sequence of function calls when the game starts up or when they are spawned in. It starts with BeginPlay(), They are Ticked(deltaTime) each frame, and when the came ends or they are destroyed EndPlay(Reason) is called. A handy note is the function Prereplication() is called before Actors are replicated, this allows you to set some values that may not be directly replicated (Such as if you have a complicated health system tracked by a component, you can have a struct replicated to clients that provides easy access to the health value to display in widgets)
AGameMode
APawn
ACharacter
AController
AGameMode
My next step was to look through the code. Thanks ArcainOne. At one time I was messing with UDK and I vaguely remember the UDK document. Thanks again.
I’m not sure I understand what you mean, but, if you want to use your custom movement component class, here is the Rama’s tutorial : A new, community-hosted Unreal Engine Wiki - Announcements and Releases - Unreal Engine Forums