Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question RayPerception for Different Behaviors

Discussion in 'ML-Agents' started by ilaydanil, May 21, 2020.

  1. ilaydanil

    ilaydanil

    Joined:
    May 17, 2020
    Posts:
    20
    Hey,
    When there is only one agent and one RayPerception, they work together automatically. But now, there are two agents and only one of them needs to use RayPerception.
    How can I specify which agent will use the RayPerception?
    Also, do I have to create different agents for each behavior? If so, how can I again specify, which agent will be responsible of which behavior?
     
  2. kahabal

    kahabal

    Joined:
    Nov 19, 2018
    Posts:
    16
    RayPerceptionSensorComponent3D has an enables property, you can try to set it to false for one of them (not sure if you can have a feedback if it worked or not)
    most likely, if you already trained an agent using it, and then you disable it, it will not be able to apply the model to get the right behaviour.
     
  3. andrewcoh_unity

    andrewcoh_unity

    Unity Technologies

    Joined:
    Sep 5, 2019
    Posts:
    162
    Yes, create two different agents with different behaviors. The RayPerception sensor is a component of an agent gameObject. You can simply not include the component on the agent that you don't want to use the ray casts.