Hello everyone,
my enemy is moving to player location even when he is not sighting the player.
i want him to attack/move after he sees the player
I’m using a behavior Tree :
Hello everyone,
my enemy is moving to player location even when he is not sighting the player.
i want him to attack/move after he sees the player
I’m using a behavior Tree :
edit: Checked the tree again and actually the decorator for the sequence that finds the player is set to check if the value for key “CanSeePlayer?” is not set, which obviously makes your character to follow the player if they are out of sight(assuming that’s how you setup the value for that key) and then attack if they are in sight.
A quick fix here would be to move everything from the left sequence to the right one then just add a wait task to the left node. That would make your character just stand in place as long as player is out of sight and if they sight the player move to the player location and attack
Hey thanks for the help here but i’m still confused.
i was fallowing a tut on youtube, then i find my self in this situation. However i set the “CanSeePlayer?” on the decorator for the sequence that finds the player
if you mean the “CanSeePlayer?” key
this is the AI Controller for which i believe the key for “CanSeePlayer?” based on the tut:
i did the quick fix but i think the enemy dose no do anything
Your blueprint looks ok.
The reason your AI does nothing is because you probably unintentionally changed the condition for the left decorator to is set which prevents the execution of the right side sequence. Try setting key query for the left side decorator to “is not set” and see if this fixes it.
An even faster fix would be to just delete the left side sequence (and the top side selector) and just run the right side sequence directly…
is this kinda work please check this out:
this is what’s happening when i hit play:
i did that but the result is not what im looking for sadly
So what’s the problem with this? The AI is attacking/moving after seeing the player, no?
yes but it dose not at first sight
Well your black board based conditions are working correctly as we can see the right side sequence runs when you are in the AI sight. The problem seems to be with the EQS query your are running (the first task in the right side sequence). It fails for the first few seconds of video so you don’t get a location your AI can move to and it just stands there doing nothing trying to find a suitable location.
I’m not really an AI expert but I will try to help fix it if you give me some screen shots of your query.
The query itself does not look problematic. Can you please show me a screen shot of the context you are using for your player(BP_EnemyContext)? I guess it simply returns the location of the player?
Also please turn on EQS visual data for AI system (numpad number 3) and take another video. I also want to see your navmesh (press P when not playing the game).
I think i might have found the problem. Remove the check for bool match on your test and try again to see if this fix it(Your query context is still kinda sus though).
i think this solved it for now, i need to run more test to make sur. Thanks so much mate!!
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.