Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Object variable not being picked up in Blueprint

Hi all, I'm wondering if someone could perhaps help me with a problem I'm having. I've followed this tutorial through to make a bot patrol between waypoints and then attack the player when it detects that the player is within a certain radius: https://wiki.unrealengine.com/Create_An_AI_Bot_in_Blueprint Now the patrolling part works fine, however after using the useful debug tool, it appears that the problem is in the BTService Blueprint Base blueprint and that one of the object variables ('EnemyActor') in this blueprint isn't being picked up properly so the == condition isn't being met which causes the branch to always be false. I could be completely wrong as I'm new to the unreal engine. I've also attached some screenshots of the behaviour tree (only the nodes I've circled in red get activated, I think because the attack branch is activated by the BTService Blueprint Base). I've also attached a screenshot of the Blackboard that I 'think' the EnemyActor object variable is set from. Sorry if I'm not very clear - I've only just recently got into this.

Thanks all, Andy :)

alt text

alt text

alt text

Product Version: UE 4.8
behaviour tree.jpg (300.1 kB)
btszombiedetect.jpg (210.8 kB)
behaviour tree.jpg (300.1 kB)
zombie_data.png (54.0 kB)
more ▼

asked Jul 31 '15 at 11:47 AM in Blueprint Scripting

avatar image

Andy Green
8 1 2 5

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hey Andy,

Blackboards don't "set" variables they only define them (keys though, not variables although they can appear similar.) you need to set the key value in the service before you perform your comparison check. Without a better view of your BP graph and better understanding of what you need I'm not sure I can give a better answer but I hope this helps some!



See this tutorial here https://docs.unrealengine.com/latest/INT/Engine/AI/BehaviorTrees/QuickStart/11/index.html

Notice the first image near the right edge where he "Set Blackboard Value As Object". You need something similar depending on the key type (object, bool, vector etc)

more ▼

answered Jul 31 '15 at 12:23 PM

avatar image

1.4k 70 29 92

avatar image Andy Green Jul 31 '15 at 12:36 PM

Thanks a lot Jesse, I really appreciate your help! I'll take a look and see if I can figure it out from the link you provided, I've attached screenshots of the entire BTService Blueprint Base 'Detect Enemy' blueprint incase you're able to see anything obvious :)

bts1.jpg (256.2 kB)
bts2.jpg (278.1 kB)
bts3.jpg (249.5 kB)
avatar image jtsmith Jul 31 '15 at 12:55 PM

I'm pretty sure you just need to set the value beforehand. If you have any other issues let me know. I'm on phone so will check out your images later but I'm confident you'll have it resolved before I'm back on. And you are very welcome!

avatar image Andy Green Jul 31 '15 at 07:34 PM

I've rebuilt the bot from the tutorial that you pasted a link to and all is well now. Thanks for that Jesse! :)

avatar image jtsmith Jul 31 '15 at 11:59 PM

You're welcome. I would be really appreciative if you accepted my answer to have resolved your question! Thanks

avatar image Andy Green Aug 01 '15 at 05:59 PM

Done! - Thanks again! :)

avatar image jtsmith Aug 01 '15 at 09:11 PM

Thanks! But to "accept" the answer you need to click the little check mark that sits below the arrows next to my answer. When you do that, the answer plus all these comments on it, will highlight green ;)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question