Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    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.