The node Move To Location or Actor succeeds even if MaxWalkSpeed is set to 0

Hi, I’m not sure if this is a bug or an intended behavior, but when I set the MaxWalkSpeed of an AI agent to 0, the Move To Location or Actor node succeeds after a certain period of time has passed.

The really strange thing is that the waiting time seems to be almost the same as the value of MaxWalkSpeed when I start the game (by default it’s 400). It’s as if the AI’s “mind” is walking normally, but the body remains still (which is quite creepy when you think about it :slight_smile: ).

If I set MaxWalkSpeed to a very low value, for example 25, the agent slowly walks towards the destination, and everything is fine.

The version is 5.3.

Any ideas?

Could you elaborate on the order of operations? On Begin Play we:

  • MoveTo
  • SetMaxWalkSpeed

Or the other way round? Or it’s done differently altogether?

I mean that when I launch the game, the default value of MaxWalkSpeed is 400. At some point a function sets MaxWalkSpeed to 0, than Move To Location or Actor is called.

I don’t really need this behavior, it is something that I noticed by messing with the prototype.

To be honest, the waiting time might not be exactly the same as the time the agent would take to reach the destination at the default speed—it could be an internal timeout of the Move To Location or Actor node. I just find it curious that the movement doesn’t simply fail or wait for the agent to actually reach the destination.

1 Like

Unable to reproduce it with:

The character stays still and the onFail triggers after 2s. Same with the other node - the one you mentioned. Also, debugged it with:

And the path get cleared.

a certain period of time has passed

Is 2 minutes enough of a wait time?

Well, it seems to me the time is around 4-5 seconds.

To be clear, it is a BTTask, here’s the setup:

EventReceiveExecuteAI -> set MaxWalkSpeed to 0 -> call a custom event named GoToLocation

Event GoToLocation -> Move To Location or Actor, OnMoveFinished -> launch an animation routine

How often does it get called? Only once? Hm, should not really matter if MaxWalkSpeed is 0 anyway. Hold on, does the onMoveFinished actuality execute? Perhaps it cannot distinguish between a successful finish and a failed one. What if you replaced it with:

It still should not move with 0 walk speed, though, ofc.

Yes, only once. As I said, if I set MaxWalkSpeed to 25, everything is fine. Bizarre.

1 Like

Just saw your edit. :slight_smile:

I use Move To Location or Actor, but I tested with AI MoveTo to print the Movement Result.
The movement fails, the result is Blocked.

1 Like