Hello! I’ve been following a tutorial on how to create an AI with vision, running towards the player if it is in sight, but for some reason, I’m unable to change between my two states (AggressiveCombat & Idle). Something does happen though, which makes me even more confused. Here’s a video of what happens when it should change states
Usually what I do/What I was taught by the bignames is SetBlackboardKeyAsText
Then you can type in the state using the literalText node.
Let me know if you cant figure that out and I’ll dig out some old AI projects. IT looks like it should work though, it could be an error in your logic. Your BTT or whatever your creating has a failure/non failure at the end? Hope this helps
Don’t forget to accept an answer that best clears your question up or answers it so when the community finds your question in the future via search/google they know exactly what you did to fix it/get it going.
There’s a “Set Blackboard Value As String”, is that the one you mean?
But yeah, I think it’d be easier if you dig up those projects, please and thank you
From what I can see on the video your problem is that the first task of the selector you’re showing there (the one with Vision service) is succeeding it’s execution, and since it’s parent is a selector it means it just finishes, not executing next child (by design). You just need to structure your BT differently. Is the first task is “state selection” and it always succeeds consider using a sequence, and have the other child be a selector with “idle” and “aggressive” branches.
BTW, a hint here: place the higher priority branch (“aggressive” I presume) on the left, and have it’s condition decorator set to Abort both. And leave idle as a condition-less fallback. It’s more robust this way
Well, it does exactly the same thing as the previous video. It shows the value of State as “MAX” when the player is not in vision, and it shows as “none” when the player is in vision
I’ll do you a better one and send you the BP, since I have been following a tutorial and just can’t see what’s going wrong there… 2 sec
It seems fine. I strongly encourage you to debug your blueprints in this case, both the Vision service and Set Player Position. Or share your project with me. Or a stripped down version that exhibits the same behavior.
It actually calms my mind hearing that “it seems fine” from someone who actually knows what they’re talking about… I’ve been combing through the code forever trying to find the issue!
So thanks to that repro project of yours I was able to nail it down, and it turns out there’s enum-to-byte blueprint conversion issue. I’ve already filed a ticket for the blueprints team to have a look at it.
The only workaround I was able to find was not to use enums for now. Just use Int or Name keys instead.
I’m terribly sorry, and thank you very much for supplying us with repro project which made finding and reproing this bug a trivial. Thanks!
Hi Mike
I was not in a hurry to try 4.9 so i did not update during the previews, but decided to update only efter the official release.
The project started as 4.8 and was converted to 4.9 official
We believe we hava fix for this. You can check it out here: b53db70. To be clear, we think this was only occuring with enums that were saved from a 4.9 preview build. Is that possibly the case here? I want to make sure we correctly resolved the issue.