I just tried that (in the same project) and it didn’t work, unfortunately. I cant change to a new project because its got loads of work in it… Thanks for the info!
Hello ,
I was able to reproduce the issue that you are seeing on your end. However, this only occurs with your assets. I created new assets in a clean project (to make sure everything was working before the test) and then migrated them over. The Ai that I created worked find in your project. Could you try making your AI in a clean 4.9 project, check to see if it is working and then migrate it to the project that is showing the issue?
When you say make my ai, what part of it do you mean? The blackboard/behavior tree? Or are you migrating code to the new project?
Ok, I made a mistake in my code. The MyAIController class should have the line;
PlayerCharacterID = BlackboardComp->GetKeyID("PlayerCharacterID");
In Possess. As it is it says “PlayerCharacter”. With that adjusted, its now got exactly the same problem the original project does, which is MoveStraightTowards works, but MoveTo doesnt.
Hello ,
After further testing I found that your target destination is the character itself. This means that the character does not move because it has already reached its target location. To test this I changed the Ai Controller of “MyBot” to one that I had made. From here I set the black board key “PlayerCharacterID” to the type actor and assigned an empty actor in the level to the black board’ss object key (PlayerCharacterID). With a new destination “MyBot” worked as expected (using “Move to”). I hope that this information helps.
Make it a great day
hi Rudy. I appreciate the feedback but don’t see how the conclusion you’ve come to could be right. The only thing I’ve changed between MoveDirectlyTowards and MoveTo is the task itself. Everything else is the same. If that was true then MoveDirectlyTowards would be affected in the same way?
Hello ,
After running a few more tests I found out why we are getting different results. It appears that if you do a rebuild in visual studio while the project is open “Move To” will function as expected until the project is closed again. This gave me an idea. After opening a fresh version of the project provided, I preformed the following steps.
Steps:
- Unzip project
- Open project
- Opened MyAIController in VS
- Changed PlayerCharacter to PlayerCharacterID (as you stated above)
- Rebuild project
- Opened BotBehaviorTree
- Changed Move Directly Towards to Move to
- Open Persistent level
- Play In Editor
- Should work fine
- Close Editor and VS
- Delete Saved, Intermediate, Derived Data Cache, Binaries
- Open project
- Open Persistent level
- Click Play In Editor
- Notice it’s still working and should be fixed now
Please try these steps on the project that was sent to me and then apply them as needed to the project that you are having issues with. I hope this information helps.
Make it a great day