# The control of the pawn is blocked without the possess function

**URL:** <https://forums.unrealengine.com/t/the-control-of-the-pawn-is-blocked-without-the-possess-function/491162>\
**Category:** C++\
**Tags:** possess, unreal-engine, question\
**Created:** [November 21, 2021, 4:09pm UTC](https://forums.unrealengine.com/t/the-control-of-the-pawn-is-blocked-without-the-possess-function/491162 "2021-11-21T16:09:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RepnikovPavel1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RepnikovPavel1](https://forums.unrealengine.com/u/RepnikovPavel1)\
**Post date:** [November 21, 2021, 4:09pm UTC](https://forums.unrealengine.com/t/the-control-of-the-pawn-is-blocked-without-the-possess-function/491162/1 "2021-11-21T16:09:13Z")

</div>

I installed a ready-made template Vehicle advanced c++. After that i write some code on c++ in tick event(or a write on bluprints - the problem remains on blueprint as well) that GetVehicleMovementComponent()-\>SetThrottleInput(1.0); for example. But this action is not applied until you call the function possess from player controller.  
What switches when possess function is called. And how fix this problem? I need the ability to control the pawn from the code (explicitly specifying the inputs for movement component) and I need the ability to call the possession function to, for example, look at the events on the map from the pawn camera.  
I find this one in source code of example.

 ![352703-снимок-экрана-2021-11-21-200428.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/9/6/5960e8a9f91a5e97730905ed1ab75f33eab08984.png)

---

<div class="post-metadata">

**Author:** ![RepnikovPavel1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RepnikovPavel1](https://forums.unrealengine.com/u/RepnikovPavel1)\
**Post date:** [November 22, 2021, 3:40pm UTC](https://forums.unrealengine.com/t/the-control-of-the-pawn-is-blocked-without-the-possess-function/491162/2 "2021-11-22T15:40:53Z")

</div>

I have solved this problem. To solve this problem, you need to go to the file \Engine\Plugins\Runtime\PhysXVehicles\Source\PhysXVehicles\Private\WheeledVehicleMovementComponent.cpp  
after that uou need to go to void UWheeledVehicleMovementComponent::UpdateState( float DeltaTime )  
and you need to remove the check for belonging to the controller:  
// update input values  
AController\* Controller = GetController();

```
// TODO: IsLocallyControlled will fail if the owner is unpossessed (i.e. Controller == nullptr);
// Should we remove input instead of relying on replicated state in that case?
if (Controller && Controller->IsLocalController())
{...} else{}

```

after that you need to recomlpile plugin PhysXVehicles or you can recompile all unreal engine code( on youtuube you can find tutorials - I found them there). I didn’t try to recompile the plugin, but I tried the whole project. it worked.

note. After everything worked - and it could not fail to work because I watched the inclusions by header files. I found another file that has the same check, however, it is not included in the code, so it does not introduce a problem, however, it can happen to you, so do the same in the file  
Engine\Plugins\Experimental\ChaosVehiclesPlugin\Source\ChaosVehicles\Private\ChaosVehicleMovementComponent.cpp
