Search Unity

Using ML agents and physics. So Confused!

Discussion in 'Physics' started by JSTTSJ, Mar 17, 2019.

  1. JSTTSJ

    JSTTSJ

    Joined:
    Jan 8, 2019
    Posts:
    3
    So I am using ML agents and trying to use AddTorque and AddForce, but it does not add force and when I Add Torque, it works, but, the player starts turning back to the starting rotation. I included the files with the post. And my GunPos does not change from the starting position. And all this worked norwal without AI.

    Edit: I decided to re-make my agent, this post could still be usefull for others.
     

    Attached Files:

    Last edited: Mar 18, 2019
  2. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,501
    Hi! welcome to this forum! I'm a user like you.
    Sorry I didn't have time to download the files.
    Maby you are missing or making a bad joint connection

    https://www.3dbuzz.com/training/view/unity-fundamentals/physics

    Do not mix things: First, make the physics side by itself without Ai. And make sure that works well without bugs. Then make the "connector" (connection to Ai). Finally, connect the Ai to that connection or connector.

    After making the joint properly, look in youtube for AddTorque

    Here there is a Unity tutorial
    https://unity3d.com/learn/tutorials/topics/physics/adding-physics-torque

    Next time place the code into the question using the "insert" icon.