How to stop the pawn exactly where I want? (Tick problem in behavior tree services)

It has an easy explanation.
What I did was “hack the navigation mesh”…
I put a collisionless mesh over the hole.
Only the vehicle collision is activated.
So the path finding system works.
The shortest path to get from point A to point B is above the hole.

To prevent it from falling into the void, you just have to stop the pawn immediately.
And launch it to the other side.
The condition is very simple too. From a mathematical point of view it should not fail.

       float JumpDistance = 100.0f;
       float JumpDeltaDistance = PawnVelocity*DeltaSeconds + JumpDistance;

	if (FVector2d::Distance(PawnLocation, BorderLocation) < JumpDeltaDistance)
	{
	     CharacterMovement->StopMovementImmediately();
	     Character->LaunchCharacter(VelocityInDirection, true, true);		
	}

Theoretically simple.
The only difficulty is to stop the pawn before it falls into the void.

Increasing the FPS helped a lot… also decreasing the tick interval from 0.5 to 0.25 seconds helps.

However, it continues to fail sometimes.

I’m starting to think that achieving precision/accuracy in this is not going to be possible.
Maybe it’s a good idea to work with the understanding that error is inevitable.

In that case, to prevent it from falling into the void, the distance would have to be increased knowing that between two ticks the pawn would be able to move a maximum distance.

But that could cause the pawn to have to make exaggeratedly large jumps.

In my case it is calculated that the error can be (±)1.5 meters. So in the worst case it must jump 3 meters plus the length of the hole… It seems unrealistic and exaggerated.

Something like this: :rofl: :rofl: :rofl:

1 Like