Code a First-Person Adventure Game Documentation : bugs

In the getting started documentation, Code a First-Person Adventure Game path I found some problems.

In Add a First-Person Camera, Mesh, and Animation section

  • The positioning of skeletal meshes are wrong.
    • Comparing to BP_FirstPersonCharacter Mesh transform is not set
    • SetupAttachment to head socket in constructor does not work. To fix it, I needed to unparent/reparent my blueprint to the c++, it seems there is a refresh bug here. It Should be mentioned in the documentation (because it seems like an old known refresh problem about c++/blueprint).

Here the result :

  • This need a if != nullptr to avoid a crash when anim has not been set in blueprint :
    // Set the animations on the first person mesh. FirstPersonMeshComponent->SetAnimInstanceClass(FirstPersonDefaultAnim->GeneratedClass);
  • This is wrong because it cast a shadow :
    Because your third-person mesh is hidden when the game begins, you only need to set animations on the first-person mesh.

Also perhaps an explanation about how/when the constructor is called (for example when playing with property in editor) could be of interest.

In Create a Respawning Pickup Item section :

  • Calling InitializePickup at each respawn will produce NewObject (is it not a leak?)
  • ReferenceItem is never really used, what it’s for. It could be used to avoid newobject leak as a cache (as it’s seems to be implied in the doc).
  • PickupDataTable should be tested with IsValid() to LoadSynchronous() if not, because of the softprtr
  • ItemDataRow should be tested to be sure row has been found
  • SetTimer must be called with -1 as last parameter, 0 will get an immediate respawn

reference documentation :

To fix the socket problem, I need to unparent/reparent my blueprint to the c++, it seems there is a refresh bug here. Should mentioned in the documentation.

hi , you can take a reference from if you’r interested here

Other problems :

  • This need a if != nullptr to avoid a crash when anim has not been set in blueprint :
    // Set the animations on the first person mesh. FirstPersonMeshComponent->SetAnimInstanceClass(FirstPersonDefaultAnim->GeneratedClass);
  • This is wrong because it cast a shadow :
    Because your third-person mesh is hidden when the game begins, you only need to set animations on the first-person mesh.

It seems your code already fixed some of the problem of this tutorial, is there a way to fix this documentation so it’s better?

I tried loading your project in 5.7. I couldn’t seem to load the umap assets. Any idea why? this is the error message:

Failed to find the world in already loaded world package /Game/Maps/L_AdventureGame! See log for more details.

I am having issues with his project as well. Consulting AI suggested changing the EditorStartupMap=/Game/FirstPerson/Lvl_FirstPerson.Lvl_FirstPerson

and

GameDefaultMap=/Game/FirstPerson/Lvl_FirstPerson.Lvl_FirstPerson

in the DefaultEngine.ini file. While this allowed the Editor to finally load, opening both Lvl_ArenaShooter and Lvl_FirstPerson display a black screen level with nothing in it. AI alos mention the L_Adventure appeared to be built with an earlier version then the 5.7.1 I am currently using? Maybe this guy has a beta version installed?