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
  3. Dismiss Notice

Question Cannot make a simple ml agents agent to aim

Discussion in 'ML-Agents' started by Dendwin, Oct 6, 2023.

  1. Dendwin


    Aug 3, 2016
    Hi all!

    I am trying to create a simple brain that would aim at a target that changes its position in the scene. However this task seemed to be way to complicated and I cannot figure out what is wrong with my set up.

    My agents is placed in the middle of the training environment and can only rotate right or left. Rotation is done by reading one continuous action. Shooting is done via one discrete action which has two states - shoot/not shoot.
    (green is agent, red is target)

    By shooting at target agent gets reward and episode begins again.
    In order to boost learning I am as well rewarding the agent for decreasing angle between it and target.

    I have attached my code as a file as well as yaml config I am using.

    I cannot get any result except from the agent learning that the win tactic is always turn right and shoot until its reached the target. It simply cannot seem to learn to turn depending on the position of the target.

    I would be grateful for any advice or example that might help me!

    Thank you in advance.

    Attached Files: