# SelfActor Not Getting Set

**URL:** <https://forums.unrealengine.com/t/selfactor-not-getting-set/755661>\
**Category:** C++\
**Tags:** Behavior-Tree, unreal-engine, CPP, question\
**Created:** [January 23, 2023, 11:48pm UTC](https://forums.unrealengine.com/t/selfactor-not-getting-set/755661 "2023-01-23T23:48:45Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Dante5050](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Dante5050](https://forums.unrealengine.com/u/Dante5050)\
**Post date:** [February 6, 2023, 8:31pm UTC](https://forums.unrealengine.com/t/selfactor-not-getting-set/755661/2 "2023-02-06T20:31:05Z")

</div>

As it turns out, a former question about the MoveTo not working with pawns had the answer nestled within it all along: [Behavior Tree MoveTo not working - #10 by perryMUFC92](https://forums.unrealengine.com/t/behavior-tree-moveto-not-working/155335/10)

Specifically, my Target class needed a custom PawnMovementComponent that reimplemented the **RequestDirectMove** function that MoveTo relies on to do its work (the answer from perry says the class needs to be a NavMovementComponent, but PawnMovementComponent works fine for me as long as that function is implemented). I stumbled upon [NavMovementComponent with Pawn in UE4 - Won Bin -John- Kang](http://www.wbjk745.com/blog/navmovementcomponent-with-pawn-in-ue4) that gave a pretty good base for how to set up the component, and then I just applied it in Target.cpp like so…

```auto
	TargetMovement = CreateDefaultSubobject<UTargetNavMovement(TEXT("Movement"));
	TargetMovement->UpdatedComponent = RootComponent;

```

and then just had to set the damping to 0 and the box is moving point to point as expected! SelfActor is still set to None, but I guess that wasn’t really the problem here.

---

_[View the full topic](https://forums.unrealengine.com/t/selfactor-not-getting-set/755661)._
