Ranged AI Enemy Ignoring Acceptance Radius

helloo all. i have a problem. I added a game manager to the scene and set the spawner actor. The range enemy created in the scene with the spawner comes next to me and attacks me. However, when I add that range enemy to the scene myself, it works fine. I don’t think I made any changes to the range enemy I added to the scene; I checked that too. in the spawner pawn class and behavior tree is true too. thanks for helps.


So, it isn’t totally clear of what you are wanting the AI to do, but I’d assume by “Ranged AI”, you’d like it to spawn and begin attacking from a distance? Looking at the behavior tree, it’s immediately calling MoveTo, which seems to be consistent with the behavior in the video. What exactly are you wanting the AI to do after spawn?

As far as things executing differently, depending on being placed in the world prior to start and spawning in real time, I feel like these kinds of issues arise due to the timing of execution. Maybe adding a short delay node prior to calling the ‘Run Behavior Tree’ node would allow variables to be set before executing BT logic, providing more consistency in execution?

heyy. i want my enemy hit me from distance like this. If I add it to the scene, it works fine. If it’s created with a spawner, it comes right next to me. I don’t want that.

Why do you have a MoveTo node in the behavior sequence? If you disconnect that from the behavior tree, does it work when spawned in real time?

idk :frowning: its still working if i disconnect from tree

its too complicated. does any one knows the reason?

You need to conditional check for ranged enemy type to determine if it should move.

IF (Ranged Enemy) {
  IF (in attack range) -> attack, else move closer or ignore.
}ELSE{
  Move to
}