This is the original tutorial series I was following.
but failed at the follow player part, and this video series didn’t use behavior trees at all. I tried the two videos and documentation linked next, which do use behavior trees, to try to fix the ai issue.
Patrol
Chase
and finally this
In following all of these, I can get the patrol to work without issues, even the original video without behavior trees. But, when I try to get the chase part to work, it fails. For example, in the documentation quick start guide, I can get the enemy to rotate to the player, but with the entire tree connected, it instantly fails the speed update and move to. Then goes right back to patrol. I disconnected everything except for wait and moveto. This is the result.
It clearly is seeing the player, but it’s not moving. Just goes right back to wait. The documentation is the third thing I’ve tried and I just haven’t been able to figure out what’s wrong. I did notice that my player does this to the nav mesh, and I’m wondering if this is the reason the enemy cant get a nav path.
My player is creating a hole in the nav mesh. Is this my issue? If so, how do I fix this. This was a project made from the standard third person game mode. I replaced the standard character with this ball and eyes, but haven’t changed anything else. Besides shrinking the collision to fit.
Could you try removing the Has Line of Signt? decorator? That should force the Chase Player to run all the time. If your Move To works then, at least you can isolate the issue.
I followed the same tutorial in the past, but used a custom decorator, everything else looks the same.
I think if your actor is making a hole on the NavMesh, the enemy should still try to go as close to them as possible? If you try removing Has Line of Sight temporarily, you can confirm this.
The root, ai_root, chase player and moveto all just flicker. Still shows that the ai sees the player. It’s just not moving.
Ok, update. I removed the moveto node, and changed it to a movedirectlyto, and that works. It turns to the player and moves towards them like it should.
What are the differences in moveto and movedirectlytoward that could be causing this?
Turns out that was the problem. I’m also running the nav mesh dyanamic, since the rooms are generated randomly, and apparently, the setting “can affect navigation” which was turned on for my player mesh spheres(body and eyes) was turned on. According to another post, having the nav mesh dynamic and “can affect navigation” on together can mess up the enemy ai.
Soon as I turned those off, the moveto worked properly