Enemy stops attacking when scale change

m633games

New member
Hi,
I'm using Behavior Tree + Movement pack + Third Person Controller. I took the existing BehaviorTree from the demo scene that is used by the enemy agent. It works well and it moves and melee attacks the player when they get close. In my scene I'm trying to make the enemy bigger by changing the scale x,y,z to twice as large, when I do that the enemy still runs after the player but doesn't melee attack anymore.

I was wondering what I should be looking for. I played around with the colliders of both the player and the enemy but didn't seem to help me. I did notice that the enemy stops attacking if I change the scale of the Y value. If I change X and Z scale the enemy still attacks well. If I change the player scale to twice as large and keep the enemy the same size, the enemy will still attack, so it's only when I make the enemy bigger that I'm having issues. Thanks!
 
Last edited:
If you open the Behavior Designer editor what task is the tree stopped on? This should give a better idea of what the problem is.
 
What is the best way to tell what task is the tree stopped on? I attached a screenshot
 

Attachments

  • 2022-09-06 (2).png
    2022-09-06 (2).png
    357.1 KB · Views: 5
It looks like your Can See Object task is returning failure. You can enable a debug ray on that task to determine why it is returning failure.
 
I clicked on the Can See Object task-> Inspector->Draw debug ray and I don't see any ray on the object that has this Behavior tree.
 
Hmm, the next best option is to set a breakpoint/Debug.Logs to see why Can See Object is returning failure. You can start to insert them within OnUpdate and trace it from there.
 
I think I will just patiently wait until the Adventure Kit is released and use it as an example, since I think Behavior Trees is a bit too advanced for my current knowledge. Thanks for the reply though!
 
Top