Search Unity

Feature Request Option to disable rotate with player on Raycast sensors

Discussion in 'ML-Agents' started by bornacvitanic, Jul 30, 2021.

  1. bornacvitanic

    bornacvitanic

    Joined:
    Feb 28, 2017
    Posts:
    11
    Would it be possible to add a checkbox, same as on the grid sensor, to ignore the agent rotation for raycast sensors?
    My agent needs to sense enemies with raycasts, for which his rotation does not matter because the attack direction is defined by the mouse position. His rotation matters for other actions like interaction.
    I currently made a KeepStartRotation script which takes the global rotation at start and sets it each frame for the child gameobject which carries the raycast sensor. If I saw correctly the Grid sensor does a similar thing, but sets the rotation to Quaternion.identity each frame.
     
  2. ruoping_unity

    ruoping_unity

    Unity Technologies

    Joined:
    Jul 10, 2020
    Posts:
    134
    This should be fairly easy to implement. I've added this feature request to our lists and hopefully we can get it out soon.