Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Question [AI Planner] Traits data accessing

Discussion in 'AI & Navigation Previews' started by gentmo, Nov 23, 2021.

  1. gentmo

    gentmo

    Joined:
    Aug 13, 2018
    Posts:
    5
    Hi, tried the AI Planner packages and get some understandings but more confused.

    From my understanding, traits are Components of Object/Entity, we can modify traits in action callbacks.However, when change traits through mono update, the changes are not seen by the planner. Is there anyway to let the planner know the changes?

    So how do we change traits that need to update every frame, for example, hp/mp regeneration? Using action callbacks to change this type of data seems incorrect.

    Thanks in advance
     
  2. gentmo

    gentmo

    Joined:
    Aug 13, 2018
    Posts:
    5
    After a little bit trying, I think I figured out.
    So it seems the DecisionController has its own data when planning, you need to set the "Next State Update" to world to sync the data with the world data(your mono data). Or you can call DecisionController.UpdateStateWithWorldQuery() at some point if you modified data want update decisionController planning data.
     
    vx4 likes this.