Behavior Tree Tutorial: failure to cast
I was working on the Behavior Tree Tutorial provided by the Unreal Engine Documentation and I got to this point: https://docs.unrealengine.com/latest/INT/Engine/AI/BehaviorTrees/QuickStart/13/index.html
I cannot find anything different about my code, yet I see this and I am sure it is why my AI never stops chasing me:
Does anyone know why it is giving me this note and/or why my AI never gives up chasing no matter how far away I am?
asked Feb 03 '16 at 01:01 AM in Blueprint Scripting
2 Different issues here. That error is because the function you wrote is expecting a return, however there is a path that could lead to possible case where nothing is return. To fix this, just connect cast failed also into the return exec node (and maybe include a debug print message like 'cast failed' or something).
The reason this may never be triggering may have to do with your 'TargetToFollow' variable. Have you verified that this variable is actually set in game? When you run your behavior tree in game, check the details panel of the tree to see what was assigned to that variable. You may have already done this, but hard to say what else could be the issue without seeing the tree.
answered Feb 03 '16 at 04:55 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here