Ml-agents: Detactable Tags in Ray Perception Sensor3D are not working

Created on 30 Jun 2020  路  1Comment  路  Source: Unity-Technologies/ml-agents

Describe the bug
I would like to use Raycast for deteching one thing however it collides with every collider in the scene.

To Reproduce
Steps to reproduce the behavior:
1.Clone https://github.com/Hsgngr/Pandemic_Simulation.git

  1. Open the project with Unity Path: Pandemic_Simulation\ml-agents-release_3\ml-agents-release_3\Project
  2. Click on 'Assets/PandemicSimulation/Scenes/T1'
  3. Inpect PandemicArea>PandemicAgent.RayPerception Sensor 3D
  4. See the error.

Screenshots
The agent's ray perception sensor (blue one) hits another cubes sphere collider which I only want to use for triggering certain actions. I dont want to detect that. There is another collider which I would like to reach.

image

My agent has 2 colliders. SphereCollider is for triggering some actions and the other one is a cube collider which is attacthed to a child of this agent. This child object has ColliderCube tag and in my Detectable Tags: I am only giving wall and ColliderCube

image

Desired Behaviour

image
It hits directly to the box collider (I deactivate other sphere collider)

Environment (please complete the following information):

  • Unity Version: Unity 2019.40f1
  • OS + version: Windows 10
  • _ML-Agents version_: mlagents Release 3
  • _TensorFlow version_: 2.2.0
  • _Environment_: FoodCollector
bug

Most helpful comment

I solved the problem by using Layers. I added a new layer for the agent prefab and only added this to the parent object. I took the cube collider and put that as a child. Then I changed only parent's layer. I closed IgnoreRaycast from Project Settings/Physics (InfectionLayer is the agent layer)

image

I unchecked the Ray Layer Mask > InfectiousLayer in RayPerceptionSensor3D

image

and voila. Now it hit as it should.

image

>All comments

I solved the problem by using Layers. I added a new layer for the agent prefab and only added this to the parent object. I took the cube collider and put that as a child. Then I changed only parent's layer. I closed IgnoreRaycast from Project Settings/Physics (InfectionLayer is the agent layer)

image

I unchecked the Ray Layer Mask > InfectiousLayer in RayPerceptionSensor3D

image

and voila. Now it hit as it should.

image

Was this page helpful?
0 / 5 - 0 ratings

Related issues

green4you picture green4you  路  4Comments

tensorgpu picture tensorgpu  路  3Comments

mattinjersey picture mattinjersey  路  3Comments

Rodnyy picture Rodnyy  路  3Comments

jlanis picture jlanis  路  4Comments