# UE4.24.2 C++ FPS tutorial has errors in code

**URL:** <https://forums.unrealengine.com/t/ue4-24-2-c-fps-tutorial-has-errors-in-code/461605>\
**Category:** Cinematics & Media\
**Tags:** UE4-24, unreal-engine, documentation, CPP, question\
**Created:** [February 11, 2020, 2:42pm UTC](https://forums.unrealengine.com/t/ue4-24-2-c-fps-tutorial-has-errors-in-code/461605 "2020-02-11T14:42:24Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Rainoxer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Rainoxer](https://forums.unrealengine.com/u/Rainoxer)\
**Post date:** [February 11, 2020, 2:42pm UTC](https://forums.unrealengine.com/t/ue4-24-2-c-fps-tutorial-has-errors-in-code/461605/6 "2020-02-11T14:42:38Z")

</div>

I finally resolved the problem #2, after diving during hours in forums.  
I simply replaced

```
FPSCameraComponent->SetupAttachment((GetCapsuleComponent());

```

by

```
FPSCameraComponent->SetupAttachment(RootComponent);

```

■■■■ the UE4 documentation needs some rework!

So I still need to fix the problem #3. #1 and #2 are solved.

---

_[View the full topic](https://forums.unrealengine.com/t/ue4-24-2-c-fps-tutorial-has-errors-in-code/461605)._
