[AI] Character is twitching severely when following player

I posted this as a question earlier, but I just created a new character, assigned the Behaviour to a new character blueprint, and the error still happens, so I decided to repost as a bug report

I have done this with previous AI, I simply set the player as a blackboard object, then I say Move To Player. When turning, the enemy twitches a lot for some reason.

What happens - http://i.giphy.com/56AV4Nsq3slgY.gif

how are you setting the blackboard object variable? are you using EQS?

No, just setting blackboard as object and set it to the player.

UPDATE: Tried creating a new character, and set the same AI. The result is still the same.

I also migrated the content to a new project. The twitching still stands.

Also tried creating a new map with a new Navmesh. Problem not yet solved.

Hey ,

I’ve attempted to reproduce this in a clean project, but have not been able to do so. Could you provide some screenshots of your setup? Also, if you have migrated the content to a simplified test project, providing that would be great if you could.

Thanks!

are you continuously setting it? like every tick or few mins? or just once and thats it?

I have this issue when I try and set vector every tick or something. But using EQS and setting the object as the actor that way never gives me twitches.

It’s kind of annoying because I can’t ever seem to be able to set a component of an actor as the target. I can only set the actor which defaults to the centre.

EDIT: I have uploaded my project and have sent a link to you in a PM in the Epic forums.

Im uploading my project to Dropbox to send it to you, where do you want me to send it to?

That might be it, I am setting it through tick. I will give it a go, thanks for the tip!

Could you explain your behavior tree setup in a bit more detail?

In order to get a bug report entered, it would be helpful if you were able to narrow down the issue in a more simplified setup so we can attempt to diagnose the root cause.

I’m pretty sure its what I mentioned above. He’s setting the player object variable as the player actor using tick in one of the character blueprints or in a task in the BT. Either way should yield the same results. It’s happens to me too.

In a player character class, create a sphere or any object and set it 10 or so feet from the capsule. Then in your AI character, add pawn sensing and then on SEE, cast to the characters BT and set a VECTOR variable to the seen actors sphere component you added earlier. You can’t set it once because he wont follow the player. Set it each tick and you should see some super twitching. Same probably applies if you set an object variable every tick. You can probably set an object once, but that doesnt help if youre using vectors which will cause the ai to run to the first setting of it but just stand there.

I’ve only ever been able to get follow to work in BT without twitching using EQS and player object variables, not vectors which again sucks because you don’t always want the actor to run to the centre of the actor its chasing.

@Sean Flint - What im doing is in the service of the AI Behaviour tree I set the player as a blackboard object. The second thing I do is use the moveTo Player in the Ai’s BT. This works fine when I have the Navmesh set to static,

however as I need the stages to be spawned the navmesh needs to be dynamic, and thats when it does not work (also when the twitching happens). If you play the game you would see it happening.

Thanks for the information everyone. I’ve been trying to recreate the setup in a clean project, but I haven’t seen the severe twitching that was shown in the project sent me, or that was shown in the initial gif.

@thankstipscom
Could you please create the setup that you’re talking about and provide a stripped down test project that showcases the issue? It’s very possible that I’m overlooking something that is causing my AI not to twitch.

Thanks!

Have you played in the project I sent you? If you do you will see it happen.
Also it doesnt twitch if you keep it to static in the navigation mesh settings, but IF:

-You make the ground spawn

-You spawn the enemies

-Set the navigation mesh to DYNAMIC

-Set the player as blackboard object in a BT

  • Choose Move to Player task from the BT

  • You’ll see it happening. I have done a new project myself with this and it twitches that way.

Hey guys,

Thanks again for all of the information. I was able to reproduce the issue in a clean project, and I’ve entered a bug report.

You can track the issue here:Unreal Engine Issues and Bug Tracker (UE-35909)

Have a great day

May AI walks and twitches. It seems that the map is too big and far away from the origin of the world. I am also looking for a solution.