AngryAnt / Behave-release

The Behave project is a system for designing, integrating and running behaviour logic using Behaviour Trees for simulated characters in unity projects. NOTE: This project relates to Behave 1. For Behave 2 support and information, please use the AngryAnt community at http://community.angryant.com
http://angryant.com/behave
34 stars 6 forks source link

Unity hangs when using Behave #64

Closed cygnusprojects closed 11 years ago

cygnusprojects commented 11 years ago

Hi,

Somewhere I must have made a mistake in my behaviortree as whenever I activate the script holding the BT logic my Unity sessions is hanging. Is there a way to find out where in the tree the loop is happening? I tried debugging the tree but the documentation is unclear on how to setup such a session.

Any advice on how to proceed?

Thanks, Wim

AngryAnt commented 11 years ago

It does indeed sound like you have some infinite recursion going on in the integration layer. I would simply use the regular monodevelop debugger to figure out where this comes from.

cygnusprojects commented 11 years ago

Found the issue. I strongly suggest to put the yield return new WaitForSeconds(1.0f / m_Tree.Frequency) within the while (Application.isPlaying) loop if you encounter this kind of behavior. Feeling stupid I missed this one.