Characters don't "Simple Move to Location" after Possessing

UE 5.1
It seems, this problem very old, and, actually, looks like a forgotten bug.
When a Player (Client in a Multiplayer game), in a case of gameplay, Possess a new Character, like in Respawn situation, Possessed Character can’t use “Simple Move to Location” function.

In some cases we can got an error “SimpleMove failed for X: movement not allowed”, in some cases we don’t, but, symptom is the same - its like "Allow Client Side Navigation” is False, but its True.

During web research, i find this article, and its says the reason is Components not updating correctly.
So, when this bug will be fixed, and how to deal with this problem, until its don’t?
Best way to bypass this problem in a blueprint, or, at least, how to use the solution from the article, if its legit?

1 Like

i find a post about this problem, is this an only legit solution at this moment?
in that case, where to place this piece of code?

so, anyone? which of these two solutions is better for multiplayer, and where to place this code?

5.2 preview
bug still there

You need to create a C++ class that inherits from the Player Controller, just like you do when creating blueprints. After creation, the Visual Studio editor will open, where you will see 2 files with the extension .h and .cpp.
In the .h file you need to add after GENERATED_BODY():

public:
UFUNCTION(BlueprintCallable)
void SimpleClientNavMove(const FVector& Destination);

To the .cpp file on the last line:

void AMySamplePlayerController::SimpleClientNavMove(const FVector& Destination)
{
UPathFollowingComponent* PathFollowingComp = FindComponentByClass();
if (PathFollowingComp == nullptr)
{
PathFollowingComp = NewObject(this);
PathFollowingComp->RegisterComponentWithWorld(GetWorld());
PathFollowingComp->Initialize();
}

if (!PathFollowingComp->IsPathFollowingAllowed())
{
	// After a client respawn we need to reinitialize the path following component
	// The default code path that sorts this out only fires on the server after a Possess
	PathFollowingComp->Initialize();
}

UAIBlueprintHelperLibrary::SimpleMoveToLocation(this, Destination);

}

Where is the AMySamplePlayerController should be replaced with the name of the created file with the prefix A at the beginning
Further, in the same .cpp file, in the Include block, you need to write:

#include “Blueprint/AIBlueprintHelperLibrary.h”
#include “Navigation/PathFollowingComponent.h”

Now, in order for everything to compile correctly, you need to add the “AIModule” module in the assembly file (YourProjectName.Build.cs) to the section PrivateDependencyModuleNames.AddRange.
After complie and run Unreal Engine you need creating blueprint inherits from your created cpp file, just click all classes and finded it.
And finily use SimpleClientNavMove node Instead of SimpleMoveToLocation
I hope I explained clearly and it will help you. If you write anything, I’m ready to help.

1 Like

can i solve this, using Blueprint?


It looks like this and got some errors, how can I solve this?

You need to cast the UPathFollowingComponent. In case anyone gets stuck here, here’s how I got it working:

1 Like

Looks like problem is still here, 5.3 version. Hope this thread will help me solving it…

5.4 bug is still here

Nice!!! Exactly what i searched for!!! Thank you very much :slight_smile:

I had a project on BluePrint version 5.6.1 when adding any C++ class - the libraries were not found. The project broke completely without the possibility of recovery. As a result, I tested the engine, and created an empty project on C++, added this class, and, lo and behold, all the libraries were visible. Then I decided to create a project from scratch on C++ and moved the Content folder from the previous one to it. Everything worked fine. It seems that in the new version of the engine, if you start a project on BluePrint, you can no longer switch to C++.

Had a similar situation recently, I could not get an enemy character to do a jump kick. It seemed no matter what method I tried to get them airborne they were locked down. What I ended up having to do was just make an enemy pawn and not a character with capsule component and movement component etc etc. All the pawn seems to need is fast fire from an Event Tick or Timeline and an addactorworldoffset and you get movement, in X, Y, or Z.

But I did find a simple way to do a “move to” AI or otherwise. Use the get unit direction vector node, the top input is where you are currently, the bottom input is where do you want to move to. Feed it with fast fire from an Event Tick, or a hidden trick here, a timeline. You can use a timeline to simulate an Event Tick. You need only set the time it should exist and you don’t even need floats or any other variables. It’s update output will act as a fast fire. And, it has a completed output so you can use that in your logic as needed. This will move something toward something, conversely reverse the inputs and outputs and something will move away from something else.

Problem here is when trying to move a possessed character class this way. For player controlled pawns using the Character class Movement has to be run through the Movement component.

Add movement Input (World Dir, scalar), Add Controller Yaw (World Dir, scalar), Add Controller Pitch (float) etc.

The Character class is a Multiplayer ready class with client-side prediction & server auth. For the server to comply with the movement it must receive it from CMC via FSaveMove buffered moves and results.

Anybody using CMC and trying to use any method outside of CMC to move the pawn will result in failure. Either you’ll get it on the client, but the server corrects and snaps you back. Or CMC will ignore it and distort the movement state.

This is a 100% no go for multiplayer.

It’s like using a Computer as Broom. Better off just using a Broom. You’ll get the results you want.